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

Allow CompactAxis in check_axis #9

Merged
merged 10 commits into from
Jan 16, 2024
Merged

Allow CompactAxis in check_axis #9

merged 10 commits into from
Jan 16, 2024

Conversation

ways
Copy link
Contributor

@ways ways commented Jan 15, 2024

As far as I understand https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97 both ValueAxis and CompactAxis should be allowed. The function check_axis currently only allow one of them. This pull request expands to allow both.

Copy link
Collaborator

@lukas-phaf lukas-phaf left a comment

Choose a reason for hiding this comment

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

Good point!

This wasn't handled because the "Compact" expression is not very compact in this case, so we never use it. But it is indeed allowed.

I added two comments. Can you also make the same change for this case?
# Check for single value of allowed axes

It would be great if you could also add a unit test. A copy of the existing spec-domain-point.json test that uses the compact form would work fine. It would test both the "required" and "allowed" case.

src/covjson_pydantic/domain.py Outdated Show resolved Hide resolved
src/covjson_pydantic/domain.py Outdated Show resolved Hide resolved
@ways
Copy link
Contributor Author

ways commented Jan 15, 2024

Test case added.

src/covjson_pydantic/domain.py Outdated Show resolved Hide resolved
src/covjson_pydantic/domain.py Outdated Show resolved Hide resolved
tests/test_coverage.py Outdated Show resolved Hide resolved
Co-authored-by: Paul van Schayck <[email protected]>
@codecov-commenter
Copy link

Codecov Report

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

Comparison is base (e74abaa) 94.54% compared to head (e38ea22) 93.90%.

Files Patch % Lines
src/covjson_pydantic/domain.py 66.66% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master       #9      +/-   ##
==========================================
- Coverage   94.54%   93.90%   -0.64%     
==========================================
  Files           9        9              
  Lines         275      279       +4     
==========================================
+ Hits          260      262       +2     
- Misses         15       17       +2     
Flag Coverage Δ
unittests 93.90% <66.66%> (-0.64%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator

@lukas-phaf lukas-phaf left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@lukas-phaf lukas-phaf merged commit 08b5445 into KNMI:master Jan 16, 2024
5 checks passed
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