Skip to content

Conversation

@keflavich
Copy link
Contributor

This initial implementation is 100% AI-generated, so do not merge it - I am pushing it so that I can perform code review and to trigger further discussion of #21. Also, I wanted to get some STC regions for use with aladin-lite, and I don't have any other way to make them.


.. Matplotlib
.. _Matplotlib: https://matplotlib.org/
.. |Patch| replace:: `~matplotlib.patches.Patch`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any region to accept any of these changes.

docs/api.rst Outdated
Comment on lines 7 to 11
.. automodapi:: regions.io.ds9
:no-inheritance-diagram:

.. automodapi:: regions.io.stcs
:no-inheritance-diagram:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should reject this change - no reason to exclude inheritance diagrams, right?

Comment on lines 209 to 218
## Contributing

When contributing to the STC-S module:

1. Follow the existing code style and patterns from the DS9 module
2. Add comprehensive tests for new functionality
3. Update documentation and examples
4. Ensure round-trip conversions work correctly
5. Test with various coordinate systems and shapes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this - these were basically instructions to the AI


## Known Limitations

- Complex STC-S features like time coordinates are not yet supported
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... weird commentary, are they so complex?

## Known Limitations

- Complex STC-S features like time coordinates are not yet supported
- Union, intersection, and other compound operations are not implemented
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable - does the standard even support them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes: "Optionally, compound sub-phrases may be recognized for compound Regions. Under those rules the CoordinateArea operational identifier (Union, Intersection, or Difference) precedes the CoordinateFrame component which, in turn, is followed by two or more (if applicable) CoordinateArea components; these CoordinateArea identifiers may be preceded by the negation operator Not. The arguments for these operators must be enclosed in parentheses. For Union and Intersection the argument may contain two or more elements; for Difference it must contain exactly two; and for Not it must contain only one. The enclosure in parentheses is merely intended to allow nesting and avoid ambiguities."

result : bool
Returns `True` if the given file is an STC-S region file.
"""
all_exten = ('.stcs', '.stc', '.stcs.txt', '.stc.txt')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do any of these files exist in the wild? I'm happy enough to establish this as a new filename convention otherwise.

Comment on lines 48 to 49
stcs_keywords = ['Circle', 'Ellipse', 'Box', 'Polygon', 'Position',
'ICRS', 'FK5', 'FK4', 'GALACTIC', 'ECLIPTIC']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are not unique - not good to use.

}

# Regular expressions for parsing STC-S strings
STCS_PATTERNS = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are hard to review; I'm just trusting for now

@@ -0,0 +1,130 @@
#!/usr/bin/env python3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this whole file is not needed; it's basically a documentation example. So I'll cut it.

@keflavich
Copy link
Contributor Author

I did a pretty simple check on a couple dozen local files, and it seems to have worked nicely.

I'd like to come up with some real-world use cases, e.g., https://cds-astro.github.io/aladin-lite/A.html#.footprintsFromSTCS, before we consider merging this, but it's at least ready for some discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant