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 a unit to all fields #23

Merged
merged 10 commits into from
Nov 16, 2022
Merged

Add a unit to all fields #23

merged 10 commits into from
Nov 16, 2022

Conversation

HealthyPear
Copy link
Member

@HealthyPear HealthyPear commented Nov 7, 2022

This PR adds a unit to all fields, in particular

  • the default unit has been set to None
  • new utility function to retrive subblock units as dictionaries
  • new dtype builder for data subblocks
  • added unit tests for all but run and event header, which depend on the version Corsika

This is both useful by itself and a precursor for #14.

@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Base: 96.19% // Head: 95.79% // Decreases project coverage by -0.39% ⚠️

Coverage data is based on head (77c08f4) compared to base (6d7096d).
Patch coverage: 92.59% of modified lines in pull request are covered.

❗ Current head 77c08f4 differs from pull request most recent head 274371e. Consider uploading reports for the commit 274371e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   96.19%   95.79%   -0.40%     
==========================================
  Files          19       20       +1     
  Lines         394      452      +58     
==========================================
+ Hits          379      433      +54     
- Misses         15       19       +4     
Impacted Files Coverage Δ
corsikaio/subblocks/run_header.py 84.00% <75.00%> (-3.50%) ⬇️
corsikaio/subblocks/event_header.py 88.57% <76.92%> (-3.43%) ⬇️
corsikaio/subblocks/__init__.py 100.00% <100.00%> (ø)
corsikaio/subblocks/data.py 100.00% <100.00%> (ø)
corsikaio/subblocks/dtypes.py 100.00% <100.00%> (ø)
corsikaio/subblocks/event_end.py 100.00% <100.00%> (ø)
corsikaio/subblocks/longitudinal.py 100.00% <100.00%> (ø)
corsikaio/subblocks/run_end.py 100.00% <100.00%> (ø)
tests/test_units.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

corsikaio/subblocks/data.py Outdated Show resolved Hide resolved
corsikaio/subblocks/data.py Outdated Show resolved Hide resolved
corsikaio/subblocks/data.py Outdated Show resolved Hide resolved
corsikaio/subblocks/data.py Outdated Show resolved Hide resolved
Copy link
Member

@maxnoe maxnoe left a comment

Choose a reason for hiding this comment

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

Minor comment, otherwise a very nice addition, thanks!

tests/test_units.py Outdated Show resolved Hide resolved
tests/test_units.py Outdated Show resolved Hide resolved
tests/test_units.py Outdated Show resolved Hide resolved
- fix syntax error in subblocks import __all__
- differentiate version warning between dtypes and fields
- unify build_data_dtype with build_dtype

Do not expose dimensionless units

Update unit-tests

Set itemsize to None in datablocks + fix comment

Fix Gev to GeV everywhere

Fix syntax when asserting against None
@maxnoe maxnoe merged commit 5684486 into main Nov 16, 2022
@maxnoe maxnoe deleted the feature_add-field-unit branch November 16, 2022 17:19
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.

2 participants