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

Drive Cycle in Experiment #1279

Closed
wants to merge 27 commits into from
Closed

Drive Cycle in Experiment #1279

wants to merge 27 commits into from

Conversation

alibh95
Copy link
Contributor

@alibh95 alibh95 commented Dec 7, 2020

Description

Added the functionality to simulate drive cycle using the experiment class.

Fixes # (issue)
#1193
#1265

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

@codecov
Copy link

codecov bot commented Dec 7, 2020

Codecov Report

Merging #1279 (a4dc137) into develop (9d42dfe) will decrease coverage by 0.21%.
The diff coverage is 47.61%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1279      +/-   ##
===========================================
- Coverage    98.07%   97.86%   -0.22%     
===========================================
  Files          270      270              
  Lines        15030    15065      +35     
===========================================
+ Hits         14741    14743       +2     
- Misses         289      322      +33     
Impacted Files Coverage Δ
pybamm/simulation.py 85.94% <47.16%> (-10.88%) ⬇️
pybamm/experiments/experiment.py 93.96% <50.00%> (-4.22%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d42dfe...2ff283c. Read the comment docs.

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.

@alibh95 , thanks very much for taking this on!

Can you add tests for the changes you have made?
After we merge #1278 , there will be a way to do this in a more efficient way, but this is a good first step.

# because drive cycles are sampled at 1Hz frequency
time = 1
period = 1
events = None
Copy link
Member

Choose a reason for hiding this comment

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

drive cycles should still (optionally) allow for events

@alibh95 alibh95 marked this pull request as draft December 10, 2020 10:52
@alibh95 alibh95 closed this Dec 10, 2020
@valentinsulzer
Copy link
Member

@alibh95 I have an idea for how to do this slightly differently. Are you still working on it?

@alibh95
Copy link
Contributor Author

alibh95 commented Dec 22, 2020

@tinosulzer Yes, I am working on this issue. Till now I am able to add the functionality of "for event" but unable to add the functionality of "until event".

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