-
-
Notifications
You must be signed in to change notification settings - Fork 56
[GSOC]-Metadata for atomic data #442
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: master
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
*beep* *bop* 2 F401 unused-import
1 E902 io-error
Complete output(might be large): carsus/io/__init__.py:7:36: F401 `carsus.io.chianti_.ChiantiIonReader` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
carsus/io/hdf.py:9:30: F401 [*] `astropy.units` imported but unused
carsus/metadata/atomic_data_with_metadata.h5:1:1: E902 stream did not contain valid UTF-8
Found 3 errors.
[*] 1 fixable with the `--fix` option.
|
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.
Pull Request Overview
This PR implements metadata support for Carsus atomic data outputs by introducing a MetadataHandler class, updating HDF5 I/O functions to include metadata, and adding corresponding tests and an example notebook.
- Introduces metadata handling for physical units, references, and git information.
- Updates HDF5 save/read functions to store and retrieve metadata alongside atomic data.
- Adds tests and an example notebook to demonstrate and verify the new metadata functionality.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
carsus/tests/test_metadata.py | Unit tests for metadata functionality including units, references, and git info. |
carsus/metadata/metadata_example.ipynb | Notebook example demonstrating the usage of the metadata handler and HDF5 I/O functions. |
carsus/metadata/metadata.py | New implementation of MetadataHandler with support for adding units and references. |
carsus/io/hdf.py | Updated functions to save and read HDF5 files with additional metadata. |
carsus/io/init.py | Updated module exports to include the new HDF5 I/O functions. |
Files not reviewed (1)
- docs/metadata.rst: Language not supported
Comments suppressed due to low confidence (1)
carsus/metadata/metadata.py:111
- Providing a url in add_reference will override the automatically generated URL from a provided doi, which may not be the intended behavior. Consider clarifying or documenting the precedence of URL assignment to avoid unexpected overrides.
if url is not None:
def _write_metadata(self, hdf: h5py.File, group: str) -> None: | ||
"""Write metadata to HDF5 group.""" | ||
if group in hdf: | ||
del hdf[group] |
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.
why are you deleting this?
📝 Description
Type: 🚀
feature
Implements metadata support for Carsus atomic data outputs as specified in the first project objective:
Metadata Table
MetadataHandler
class stores:"angstrom"
,"Hz"
)Output Formats
/metadata
group (units, references, git info)read_hdf_with_metadata()
Automation (Bonus)
"not_a_unit"
)📜 Example Usage
🚦 Testing
Unit Tests: pytest tests/test_metadata.py (100% coverage)

Manual Verification:
☑️ Checklist