-
Notifications
You must be signed in to change notification settings - Fork 5
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
Cardiac tutorial #233
base: main
Are you sure you want to change the base?
Cardiac tutorial #233
Conversation
- Based on Max's pipeline scripts - Includes sampling, simulation, emulation, and sensitivity analysis
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
blackfmt
[blackfmt] reported by reviewdog 🐶
fig, ax = plt.subplots(ncols=2, figsize = (10, 5)) |
[blackfmt] reported by reviewdog 🐶
autoemulate/autoemulate/simulations/flow_functions.py
Lines 138 to 149 in 0f1382d
ax[0].plot(self.res.t, self.res.y[2*i,:] , 'r', alpha=0.1 + (1.-i/self.ncomp) *0.9) | |
ax[1].plot(self.res.t, self.res.y[2*i+1,:] , 'r', alpha=0.1 + (1.-i/self.ncomp) *0.9) | |
ax[0].set_title('Pressure') | |
ax[1].set_title('Flow rate') | |
ax[0].set_xlabel('Time (s)') | |
ax[1].set_xlabel('Time (s)') | |
ax[0].set_ylabel('mmHg') | |
ax[1].set_ylabel('$ml\cdot s^{-1}$') | |
return (fig, ax) |
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #233 +/- ##
==========================================
- Coverage 94.28% 92.07% -2.21%
==========================================
Files 62 63 +1
Lines 3587 3672 +85
==========================================
- Hits 3382 3381 -1
- Misses 205 291 +86 ☔ View full report in Codecov by Sentry. |
@MaxBalmus I managed to transfer our original commits into the autoemulate repo, I think it makes more sense to work here directly, so that Martin can chip in where appropriate. |
@MaxBalmus @aranas: This is great! It would be best to make the simulation a function to be consistent with the other simulations eventually, but this isn't urgent. Let me know when I should have a look at it! |
autoemulate/sensitivity_analysis.py
Outdated
|
||
# Use custom names if provided, else default to "x1", "x2", etc. | ||
parameter_names = ( | ||
problem["names"] if problem is not None else [f"x{i+1}" for i in range(len(next(iter(results.values()))["S1"]))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
problem["names"] if problem is not None else [f"x{i+1}" for i in range(len(next(iter(results.values()))["S1"]))] | |
problem["names"] | |
if problem is not None | |
else [f"x{i+1}" for i in range(len(next(iter(results.values()))["S1"]))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should resolve #279
34eb66e
to
a36f768
Compare
autoemulate/metrics.py
Outdated
discrepancy = np.atleast_1d(discrepancy) | ||
n_obs = len(obs_mean) | ||
rank = min(max(rank, 0), n_obs - 1) | ||
# Vs represents the total variance associated with the observations, predictions, and potential discrepancies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
# Vs represents the total variance associated with the observations, predictions, and potential discrepancies. | |
# Vs represents the total variance associated with the observations, predictions, and potential discrepancies. |
…n benefit from removing some of teh hardcoded parameters and making them input.
this PR is a work in progress on the tutorial showcasing how autoemulate can be embedded into an end-to-end cardiac modelling pipeline including sensitivity analysis.
This tutorial still requires some improvements