-
-
Notifications
You must be signed in to change notification settings - Fork 58
STC-S draft implementation #619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| .. Matplotlib | ||
| .. _Matplotlib: https://matplotlib.org/ | ||
| .. |Patch| replace:: `~matplotlib.patches.Patch` |
There was a problem hiding this comment.
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
| .. automodapi:: regions.io.ds9 | ||
| :no-inheritance-diagram: | ||
|
|
||
| .. automodapi:: regions.io.stcs | ||
| :no-inheritance-diagram: |
There was a problem hiding this comment.
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?
regions/io/stcs/README.md
Outdated
| ## 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 | ||
|
|
There was a problem hiding this comment.
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
regions/io/stcs/README.md
Outdated
|
|
||
| ## Known Limitations | ||
|
|
||
| - Complex STC-S features like time coordinates are not yet supported |
There was a problem hiding this comment.
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?
regions/io/stcs/README.md
Outdated
| ## Known Limitations | ||
|
|
||
| - Complex STC-S features like time coordinates are not yet supported | ||
| - Union, intersection, and other compound operations are not implemented |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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.
regions/io/stcs/connect.py
Outdated
| stcs_keywords = ['Circle', 'Ellipse', 'Box', 'Polygon', 'Position', | ||
| 'ICRS', 'FK5', 'FK4', 'GALACTIC', 'ECLIPTIC'] |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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
regions/io/stcs/example_usage.py
Outdated
| @@ -0,0 +1,130 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
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.
|
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. |
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.