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

Avoid error if no measurements in PEtab problem; fix type handling in PEtab parameter mapping #1783

Merged
merged 4 commits into from
Apr 21, 2022

Conversation

dilpath
Copy link
Member

@dilpath dilpath commented Apr 21, 2022

No measurements can occur if simulating a timecourse as a series of PEtab problems, where each PEtab problem has a subset of the original measurements table, and some timecourse period happens to have no measurements during it.

iterrows fails if simulation_conditions is passed as a dictionary.

zip(simulation_conditions.iterrows(), prelim_parameter_mapping):

@dilpath dilpath requested a review from dweindl April 21, 2022 08:07
@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #1783 (4e63e6f) into develop (3ab64c2) will increase coverage by 0.01%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1783      +/-   ##
===========================================
+ Coverage    78.07%   78.08%   +0.01%     
===========================================
  Files           74       74              
  Lines        12151    12154       +3     
===========================================
+ Hits          9487     9491       +4     
+ Misses        2664     2663       -1     
Flag Coverage Δ
cpp 75.05% <ø> (+0.02%) ⬆️
petab 60.71% <75.00%> (+<0.01%) ⬆️
python 68.37% <0.00%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
python/amici/petab_objective.py 93.90% <75.00%> (-0.43%) ⬇️
src/sundials_matrix_wrapper.cpp 80.53% <0.00%> (+0.44%) ⬆️

Comment on lines 156 to 159
if not sim_cond.empty:
for i, rdata in enumerate(rdatas):
logger.debug(f"Condition: {sim_cond.iloc[i, :].values}, status: "
f"{rdata['status']}, llh: {rdata['llh']}")
Copy link
Member

Choose a reason for hiding this comment

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

Might be confusing to look at the log and not seeing any output for the respective condition? Maybe just replace {sim_cond.iloc[i, :].values} by N/A if unavailable?

@sonarcloud
Copy link

sonarcloud bot commented Apr 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dilpath dilpath merged commit b951f39 into develop Apr 21, 2022
@dilpath dilpath deleted the fix_empty_measurements branch April 21, 2022 17:39
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