-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Improve Handling of J Values in CMFGEN Data #409 #428
Open
manas-dhyani
wants to merge
1
commit into
tardis-sn:master
Choose a base branch
from
manas-dhyani:cmfgen
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*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:917:42: F405 `HC_IN_EV_ANGSTROM` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:920:46: F405 `RYD_TO_EV` may be undefined, or defined from star imports
carsus/io/cmfgen/base.py:925:29: E741 Ambiguous variable name: `l`
carsus/io/cmfgen/base.py:928:35: F405 `RYD_TO_EV` may be undefined, or defined from star imports
Found 56 errors.
[*] 2 fixable with the `--fix` option.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
Type: 🚀 feature
This PR addresses issue #409 by implementing a cleaner handling of J values in CMFGEN data. Previously, J values were dropped in cross_sections_squeeze, causing loss of information. Since storing J values in ion_levels is not feasible due to shape mismatch, this PR introduces a separate DataFrame for J values.
Changes made:
-Extracted J values from energy levels.
-Computed J values using the formula: .
-Stored J values in a new DataFrame indexed by atomic_number, ion_charge, and ID.
-Added self.j_values attribute to CMFGENReader to store J values.
-Ensured J values are properly structured and retrievable.
This update ensures that J values are preserved and can be used in future calculations, improving the overall data handling in Carsus.
Closes #409.
📌 Resources
CMFGEN Atomic Data
Carsus Documentation
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
labelOutput