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

Extended Amici history #1263

Merged
merged 26 commits into from
Jan 16, 2024
Merged

Extended Amici history #1263

merged 26 commits into from
Jan 16, 2024

Conversation

plakrisenko
Copy link
Member

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (cbde009) 84.33% compared to head (9c9a229) 84.39%.

Files Patch % Lines
pypesto/objective/amici/amici.py 93.33% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1263      +/-   ##
===========================================
+ Coverage    84.33%   84.39%   +0.06%     
===========================================
  Files          151      152       +1     
  Lines        12333    12420      +87     
===========================================
+ Hits         10401    10482      +81     
- Misses        1932     1938       +6     

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

Copy link
Member

@dilpath dilpath 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 👍 I'm not familiar with the differences between the implementations for CSV and HDF5 history, so some of my feedback might be trivial.

pypesto/C.py Outdated Show resolved Hide resolved
Comment on lines +44 to +46
@staticmethod
def _simulation_to_values(x, result, used_time):
values = Hdf5History._simulation_to_values(x, result, used_time)
Copy link
Member

Choose a reason for hiding this comment

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

Here it's @staticmethod, but n CsvAmiciHistory it's super().... Just curious, why?

Copy link
Member Author

Choose a reason for hiding this comment

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

In CsvHistory it's not static as it uses dynamically updated attributes (e.g. _n_fval), in Hdf5History it's not the case, so I made the methods static both in Hdf5History and Hdf5AmiciHistory.

Comment on lines 146 to 157
def _trace_columns(self) -> list[tuple]:
columns = super()._trace_columns()
return columns + [
(c, np.nan)
for c in [
CPU_TIME_TOTAL,
PREEQ_CPU_TIME,
PREEQ_CPU_TIME_B,
POSTEQ_CPU_TIME,
POSTEQ_CPU_TIME_B
]
]
Copy link
Member

Choose a reason for hiding this comment

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

Should this also exist for Hdf5AmiciHistory?

Copy link
Member Author

@plakrisenko plakrisenko Dec 22, 2023

Choose a reason for hiding this comment

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

This is for _init_trace which is only needed in Csv case, I think

pypesto/history/csv.py Outdated Show resolved Hide resolved
@plakrisenko plakrisenko marked this pull request as ready for review December 22, 2023 16:53
test/base/test_history.py Outdated Show resolved Hide resolved
test/base/test_history.py Show resolved Hide resolved
Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
Copy link
Member

@dweindl dweindl left a comment

Choose a reason for hiding this comment

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

Thx

pypesto/optimize/optimizer.py Outdated Show resolved Hide resolved
pypesto/history/amici.py Show resolved Hide resolved
pypesto/history/amici.py Show resolved Hide resolved
Copy link
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

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

Thanks :)

Comment on lines +740 to +755
assert np.all(
history.get_cpu_time_total_trace()
>= history.get_preeq_time_trace()
)
assert np.all(
history.get_cpu_time_total_trace()
>= history.get_preeq_timeB_trace()
)
assert np.all(
history.get_cpu_time_total_trace()
>= history.get_posteq_time_trace()
)
assert np.all(
history.get_cpu_time_total_trace()
>= history.get_posteq_timeB_trace()
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't a better assertion actually be to assert the sum over the different traces to be smaller equal than the total time?

Copy link
Member

Choose a reason for hiding this comment

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

complementary

@plakrisenko plakrisenko merged commit 7229c35 into develop Jan 16, 2024
18 checks passed
This was referenced Jan 30, 2024
@plakrisenko plakrisenko deleted the amici_history branch April 12, 2024 15:20
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.

7 participants