Skip to content
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

add vald shortlist parsing as well as handling for wavelength in vacuum/air and nm/aa #386

Merged
merged 17 commits into from
Dec 11, 2023

Conversation

jvshields
Copy link
Contributor

@jvshields jvshields commented Nov 16, 2023

📝 Description

Type: : 🚀 feature |

This PR modifies the vald parser to add some extra functionality for more varied vald outputs.

There are some missed lines in codecov to account for if the units of the wavelengths are in nm instead of angstroms, but I can't cover them unless I upload more data files and I've been trying to be sparing with that. I can upload them and cover them if that'd be preferred.

🚦 Testing

  • Testing pipeline
  • Other method (describe)
  • My changes can't be tested (explain why)

☑️ Checklist

  • I requested two reviewers for this pull request
  • I updated the documentation according to my changes
  • I built the documentation by applying the build_docs label

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

@jvshields jvshields marked this pull request as draft November 16, 2023 21:11
Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (de795f6) 68.54% compared to head (5293e2e) 68.65%.

Files Patch % Lines
carsus/io/vald/vald.py 82.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #386      +/-   ##
==========================================
+ Coverage   68.54%   68.65%   +0.11%     
==========================================
  Files          30       30              
  Lines        3608     3650      +42     
==========================================
+ Hits         2473     2506      +33     
- Misses       1135     1144       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jvshields jvshields marked this pull request as ready for review November 20, 2023 16:49

self._vald_columns = (
self.vald_shortlist_columns.copy()
if shortlist
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a big fan of ternary operators, but I also won't argue strongly if you want to keep this one

carsus/io/vald/vald.py Outdated Show resolved Hide resolved
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@andrewfullard andrewfullard left a comment

Choose a reason for hiding this comment

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

Love the notebook

carsus/conftest.py Outdated Show resolved Hide resolved
carsus/io/vald/vald.py Outdated Show resolved Hide resolved
@@ -103,7 +103,7 @@ def memory_session():

@pytest.fixture(scope="session")
def data_dir():
return os.path.join(os.path.dirname(__file__), "tests", "data")
return Path(__file__).parent / "tests" / "data"
Copy link
Member

Choose a reason for hiding this comment

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

I would not make this a fixture but a single constant DATA_DIR_PATH


# Need to identify the wavelength column header and overwrite the wavelength to obtain units and air or vacuum
# Also need to identify if Vmic is in the columns for correct column construction
for line in content.split("\n")[:10]:
Copy link
Member

Choose a reason for hiding this comment

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

make an issue about pattern matching.

@wkerzendorf wkerzendorf merged commit d5853ba into tardis-sn:master Dec 11, 2023
4 checks passed
@jvshields
Copy link
Contributor Author

Created issue #389 as a future project idea.

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.

4 participants