-
-
Notifications
You must be signed in to change notification settings - Fork 56
[GSOC] Add a metadata table to an existing Carsus output #433
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
…rames -Modify _get_levels_lines to attach metadata (DOI, reference, and units) to levels and lines. -Verified metadata is correctly assigned to attrs.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
*beep* *bop* 48 F405 [ ] undefined-local-with-import-star-usage
5 E741 [ ] ambiguous-variable-name
1 F401 [*] unused-import
1 F403 [ ] undefined-local-with-import-star
1 F541 [*] f-string-missing-placeholders
Complete output(might be large): carsus/io/cmfgen/base.py:9:19: F401 [*] `scipy.interpolate` imported but unused
carsus/io/cmfgen/base.py:15:1: F403 `from .util import *` used; unable to detect undefined names
carsus/io/cmfgen/base.py:34:18: F405 `parse_header` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:35:23: F405 `find_row` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:55:26: F405 `find_row` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:106:18: F405 `parse_header` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:107:23: F405 `find_row` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:158:35: F405 `to_float` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:159:35: F405 `to_float` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:179:18: F405 `parse_header` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:180:23: F405 `find_row` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:191:18: F405 `find_row` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:197:26: F405 `find_row` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:202:44: F405 `to_float` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:218:39: F405 `to_float` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:282:67: F405 `to_float` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:289:41: F405 `to_float` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:300:18: F405 `parse_header` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:301:14: F405 `open_cmfgen_file` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:354:18: F405 `parse_header` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:364:23: F405 `find_row` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:373:20: E741 Ambiguous variable name: `l`
carsus/io/cmfgen/base.py:401:12: E741 Ambiguous variable name: `l`
carsus/io/cmfgen/base.py:448:12: E741 Ambiguous variable name: `l`
carsus/io/cmfgen/base.py:566:25: F405 `CMFGEN_ATOM_DICT` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:610:25: E741 Ambiguous variable name: `l`
carsus/io/cmfgen/base.py:681:21: F405 `HC_IN_EV_ANGSTROM` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:681:62: F405 `RYD_TO_EV` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:684:42: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:685:35: F405 `get_null_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:688:21: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:689:21: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:690:21: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:701:21: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:702:21: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:714:39: F405 `get_null_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:717:39: F405 `get_seaton_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:721:44: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:731:43: F405 `get_hydrogenic_n_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:741:21: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:742:21: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:754:35: F405 `get_hydrogenic_nl_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:761:44: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:770:35: F405 `get_opproject_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:774:44: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:783:35: F405 `get_hummer_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:787:44: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:796:35: F405 `get_vy95_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:800:44: F405 `CrossSectionType` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:810:39: F405 `get_leibowitz_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:816:29: F541 [*] f-string without any placeholders
carsus/io/cmfgen/base.py:818:39: F405 `get_null_phixs_table` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:929:42: F405 `HC_IN_EV_ANGSTROM` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:932:46: F405 `RYD_TO_EV` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:937:29: E741 Ambiguous variable name: `l`
carsus/io/cmfgen/base.py:940:35: F405 `RYD_TO_EV` may be undefined, or defined from star imports
Found 56 errors.
[*] 2 fixable with the `--fix` option.
|
@afloers @andrewfullard could you please review this. |
|
||
# Generate metadata dynamically |
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 think this is dynamic if the values are hardcoded, though it does demonstrate your method works.
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 took this as an example because the first GSoC objective stated to attach a DOI reference and physical units to one of the outputs. However, I agree that a more dynamic approach would be beneficial in future and plan to add parameters to the relevant functions so that metadata can be passed as a dictionary.
Hi @andrewfullard, I’ve submitted my application on the GSoC official page—thank you so much for your guidance throughout the process! |
📝 Description
Type: 🚀 feature
This PR introduces metadata attachment to Carsus DataFrames (levels and lines). Metadata includes:
DOI: Citation for data source
Reference: Source publication
Units: Mapping of relevant physical units
Changes
_get_levels_lines
to attach metadata (doi
,reference
, andunits
) to levels and lines.attrs.update(metadata)
to store metadata in Pandas DataFrames.#Verification
levels.attrs
andlines.attrs
to verify metadata assignment.📌 Resources
🔗 Verner et al. 1996 DOI
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
labelAdding Metadata to existing carsus output
Saving DataFrames with Metadata to HDF5
Loading HDF5 for metadata
Automation