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

AggregatedObjective: objective-specific kwargs for call_unprocessed #1068

Merged
merged 10 commits into from Jun 6, 2023

Conversation

Theorell
Copy link
Contributor

It should be possible to pass kwargs to AmiciObjective. At the moment, if you make an AggregatedObjective with a prior (which takes kwargs), and an AmiciObjective, trying to use the kwargs will lead to an error.

@codecov-commenter
Copy link

codecov-commenter commented May 25, 2023

Codecov Report

Merging #1068 (7c0463b) into develop (160c2a8) will decrease coverage by 3.31%.
The diff coverage is 88.01%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff             @@
##           develop    #1068      +/-   ##
===========================================
- Coverage    88.16%   84.86%   -3.31%     
===========================================
  Files           79      147      +68     
  Lines         5257    11399    +6142     
===========================================
+ Hits          4635     9674    +5039     
- Misses         622     1725    +1103     
Impacted Files Coverage Δ
pypesto/engine/mpi_pool.py 0.00% <0.00%> (ø)
pypesto/objective/amici/__init__.py 100.00% <ø> (ø)
pypesto/objective/amici/amici.py 85.15% <ø> (ø)
pypesto/objective/amici/amici_calculator.py 86.36% <ø> (ø)
pypesto/objective/amici/amici_util.py 81.53% <ø> (ø)
pypesto/objective/base.py 87.62% <ø> (-0.10%) ⬇️
pypesto/objective/finite_difference.py 94.16% <ø> (ø)
pypesto/objective/function.py 94.91% <ø> (+19.91%) ⬆️
pypesto/objective/jax/__init__.py 100.00% <ø> (ø)
pypesto/objective/jax/base.py 91.56% <ø> (ø)
... and 137 more

@dilpath
Copy link
Member

dilpath commented May 25, 2023

Looks reasonable but might be problematic to assume that keyword arguments between objectives are comparable.

Instead, we could change AggregatedObjective.call_unprocessed to accept a keyword argument kwargs_list, which is one dictionary of keyword arguments per objective. **kwargs can still be used for all objectives as before.

I made this suggestion in a commit, feel free to revert if undesired.

Comment on lines +96 to +97
Objective-specific keyword arguments, where the dictionaries are
ordered by the objectives.
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense to have it objective-specific 👍

pypesto/objective/aggregated.py Outdated Show resolved Hide resolved
pypesto/objective/amici/amici.py Outdated Show resolved Hide resolved
Copy link
Contributor

@FFroehlich FFroehlich left a comment

Choose a reason for hiding this comment

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

👍

@dweindl dweindl changed the title Kwargs in amici call AggregatedObjective: objective-specific kwargs for call_unprocessed Jun 6, 2023
@dweindl dweindl merged commit 6dae3dc into ICB-DCM:develop Jun 6, 2023
17 checks passed
This was referenced Jun 22, 2023
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.

None yet

7 participants