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

#6: Implemented DataHandler class and extract/remove/namelist #7

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

johannesbulin
Copy link
Collaborator

(See issue #6)

Added support for data pipelines to ifsbench. The main feature is a DataHandler base class that can perform a given action on a working directory. Currently I've implemented:

  • RenameHandler - for moving/renaming/copying files, using regular expressions.
  • NamelistHandler - for modifying namelists.
  • ExtractHandler - for extracting archives.

Talking points / request for feedback:

  • At the moment, nothing in the data pipeline uses the InputFile concept that we've used before (with file hashes and other things). If you think that this should be included, I'd be happy about some suggestions.
  • I am not a big fan of having enums as embedded classes (RenameHandler.RenameMode for example). It's a bit clunky to write but I haven't come up with a better solution.

@FussyDuck
Copy link

FussyDuck commented Dec 16, 2024

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 98.67550% with 2 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@a847cbd). Learn more about missing BASE report.

Files with missing lines Patch % Lines
ifsbench/data/datahandler.py 83.33% 1 Missing ⚠️
ifsbench/data/renamehandler.py 97.95% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main       #7   +/-   ##
=======================================
  Coverage        ?   78.15%           
=======================================
  Files           ?       22           
  Lines           ?     1927           
  Branches        ?        0           
=======================================
  Hits            ?     1506           
  Misses          ?      421           
  Partials        ?        0           

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

Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Thanks, this looks great already!

I left a lot of nitpicky comments but mostly around style and docstrings. Implementation looks mostly good to me and testing is very diligently done!

ifsbench/data/datahandler.py Outdated Show resolved Hide resolved
ifsbench/data/datahandler.py Outdated Show resolved Hide resolved
ifsbench/data/__init__.py Outdated Show resolved Hide resolved
ifsbench/data/extracthandler.py Outdated Show resolved Hide resolved
ifsbench/data/extracthandler.py Outdated Show resolved Hide resolved
ifsbench/data/renamehandler.py Outdated Show resolved Hide resolved
ifsbench/data/renamehandler.py Outdated Show resolved Hide resolved
ifsbench/data/renamehandler.py Outdated Show resolved Hide resolved
ifsbench/data/renamehandler.py Outdated Show resolved Hide resolved
tests/data/test_renamehandler.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@mlange05 mlange05 left a comment

Choose a reason for hiding this comment

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

This looks great, and aside from the marked docstrings the design is very neat. I agree with all that was said before and look forward to seeing the actual "pipelines" in action.

Will mark only as comment for now, until all of B.'s points are addressed, but looks good to me otherwise.

johannesbulin added a commit to johannesbulin/ifsbench that referenced this pull request Jan 10, 2025
@johannesbulin johannesbulin force-pushed the johannesbulin.datahandler.#6 branch from 65dedfc to 854b655 Compare January 10, 2025 14:37
Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Many thanks for making the suggested changes! Looks great to me now.

else:
self._target_dir = pathlib.Path(target_dir)

def execute(self, wdir, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if it works like this but fine with keeping it like this for now.

@reuterbal reuterbal linked an issue Jan 20, 2025 that may be closed by this pull request
Copy link
Collaborator

@mlange05 mlange05 left a comment

Choose a reason for hiding this comment

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

LGTM

@reuterbal reuterbal merged commit c0b6ccb into ecmwf-ifs:main Jan 20, 2025
9 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.

ifsbench.files for data pipeline
5 participants