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 tags to Experiment #2593

Merged
merged 9 commits into from Jan 6, 2023
Merged

Add tags to Experiment #2593

merged 9 commits into from Jan 6, 2023

Conversation

brosaplanella
Copy link
Sponsor Member

@brosaplanella brosaplanella commented Jan 5, 2023

Description

Tags can be added to the end of an experiment as [tag1,tag2]. I have added the method search_tag which returns the list of cycles with a certain tag, which should help saving only certain cycles.

Fixes #2538

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ flake8
  • All tests pass: $ python run-tests.py --unit
  • The documentation builds: $ cd docs and then $ make clean; make html

You can run all three at once, using $ python run-tests.py --quick.

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@brosaplanella
Copy link
Sponsor Member Author

At the moment we are not using the "tags" entry of the dictionary of processed experiments (I realised I didn't need it after writing that part). Should I remove them or keep it (could be useful in the future).

@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Base: 99.69% // Head: 99.69% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (709cccb) compared to base (59b63d5).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2593   +/-   ##
========================================
  Coverage    99.69%   99.69%           
========================================
  Files          271      271           
  Lines        19540    19560   +20     
========================================
+ Hits         19480    19500   +20     
  Misses          60       60           
Impacted Files Coverage Δ
pybamm/experiments/experiment.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.

Copy link
Member

@valentinsulzer valentinsulzer left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@@ -440,3 +454,16 @@ def is_cccv(self, step, next_step):
if op["events"] == {k: v for k, v in next_op.items() if k in op["events"]}:
return True
return False

def search_tag(self, tag):
Copy link
Member

Choose a reason for hiding this comment

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

seems like this should use the "tags" entry of the dictionary?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

That was my original idea, but then I couldn't find a clear mapping between operating_conditions and the actual cycle number. Going forward, when we implement #2322, that will have to be addressed and will make more sense to use the dictionary. But for the time being, processing the strings is fast enough.

@brosaplanella brosaplanella merged commit fa5ec1b into develop Jan 6, 2023
@brosaplanella brosaplanella deleted the issue-2538-tag-experiments branch January 6, 2023 14:35
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.

Tag experiments [former Reference Performance Test (RPT) experiment]
2 participants