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

refactor: remove sec_cats #277

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

refactor: remove sec_cats #277

wants to merge 4 commits into from

Conversation

mikapfl
Copy link
Member

@mikapfl mikapfl commented Oct 22, 2024

Pull request

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Description in a {pr}.thing.md file in the directory changelog added - see changelog/README.md for details

Description

Remove sec_cats:

  • from the documentation of the data formats
  • from tests
  • from the formal definitions of data formats

However, we retain:

  • backwards compatibility for reading: We just ignore sec_cats when loading from CSV or netcdf.
  • when converting free-form DataFrames to interchange format, you still have to specify secondary categories using the sec_cat__ prefix, for backward compatibility and because it's a useful feature to guard against typos.

Note that this is a breaking change, if you e.g. read something from interchange format, then save it back to interchange format, it will remove the sec_cats entry.

Closes: #217

@mikapfl mikapfl self-assigned this Oct 22, 2024
@mikapfl
Copy link
Member Author

mikapfl commented Oct 22, 2024

Unfortunately, there are a lot of places where sec_cats were used. The tests now pass, but I still think this is a medium-risk PR. Maybe we can test something from the non-AnnexI repo to see if it still works?

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.18%. Comparing base (5a5deb0) to head (3930b2b).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
primap2/pm2io/_interchange_format.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #277      +/-   ##
==========================================
- Coverage   97.25%   97.18%   -0.08%     
==========================================
  Files          47       47              
  Lines        4441     4399      -42     
==========================================
- Hits         4319     4275      -44     
- Misses        122      124       +2     

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

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.

Abandon sec_cats
1 participant