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 law of motion. #373

Merged
merged 8 commits into from
Aug 19, 2020
Merged

Refactor law of motion. #373

merged 8 commits into from
Aug 19, 2020

Conversation

tobiasraabe
Copy link
Member

  • Refactor the law of motion such that the whole logic is only in one place.
  • Simplify the collection of child indices.

@tobiasraabe tobiasraabe added this to the 2.0.0 milestone Aug 4, 2020
@codecov
Copy link

codecov bot commented Aug 4, 2020

Codecov Report

Merging #373 into main will increase coverage by 0.46%.
The diff coverage is 86.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #373      +/-   ##
==========================================
+ Coverage   85.42%   85.89%   +0.46%     
==========================================
  Files          47       47              
  Lines        3411     3410       -1     
==========================================
+ Hits         2914     2929      +15     
+ Misses        497      481      -16     
Flag Coverage Δ
#end_to_end 75.24% <84.31%> (+0.46%) ⬆️
#integration 65.42% <84.31%> (+0.54%) ⬆️
#unit 70.05% <86.27%> (+0.57%) ⬆️

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

Impacted Files Coverage Δ
respy/shared.py 82.81% <73.68%> (+0.95%) ⬆️
respy/_numba.py 87.17% <80.00%> (-1.06%) ⬇️
respy/state_space.py 93.86% <94.73%> (+5.81%) ⬆️
respy/simulate.py 93.56% <100.00%> (-0.34%) ⬇️
respy/tests/test_simulate.py 100.00% <100.00%> (ø)
respy/interpolate.py 96.34% <0.00%> (+1.21%) ⬆️

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 ddde5de...c5b44f7. Read the comment docs.

Copy link
Member

@mo2561057 mo2561057 left a comment

Choose a reason for hiding this comment

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

Great PR. Very useful to recognize that the LOM and the child index creation use the same logic!


if is_n_step_ahead and period != n_simulation_periods - 1:
df = _apply_law_of_motion(current_df_extended, optim_paras)
Copy link
Member

Choose a reason for hiding this comment

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

Would it be an option to not apply the law of motion here but take choice and dense key to get the next indices directly from the state space?
Then we would also save the indexer step and save the calculation.

Copy link
Member Author

@tobiasraabe tobiasraabe Aug 17, 2020

Choose a reason for hiding this comment

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

I have created the issue #376 to discuss your point. Even if my point on cpu bound and io bound is not true, it makes sense to separate the changes. Is it ok with you?

respy/state_space.py Show resolved Hide resolved
@tobiasraabe tobiasraabe merged commit dc44f6a into main Aug 19, 2020
@tobiasraabe tobiasraabe deleted the refactor-law-of-motion branch August 19, 2020 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants