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

visualization of optimization result properties #486

Merged
merged 14 commits into from
Nov 10, 2020
Merged

Conversation

plakrisenko
Copy link
Member

@plakrisenko
Copy link
Member Author

If anyone could suggest better function names would be nice :)

@codecov-io
Copy link

codecov-io commented Oct 19, 2020

Codecov Report

Merging #486 into develop will decrease coverage by 0.10%.
The diff coverage is 87.25%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #486      +/-   ##
===========================================
- Coverage    90.81%   90.70%   -0.11%     
===========================================
  Files           70       71       +1     
  Lines         4027     4121      +94     
===========================================
+ Hits          3657     3738      +81     
- Misses         370      383      +13     
Impacted Files Coverage Δ
pypesto/visualize/reference_points.py 85.71% <ø> (ø)
pypesto/visualize/misc.py 77.63% <41.66%> (-6.20%) ⬇️
pypesto/visualize/optimization_stats.py 92.85% <92.85%> (ø)
pypesto/visualize/__init__.py 100.00% <100.00%> (ø)
pypesto/visualize/clust_color.py 92.85% <100.00%> (+0.08%) ⬆️
pypesto/objective/amici_util.py 83.03% <0.00%> (-0.90%) ⬇️

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 cc8edb1...088bb85. Read the comment docs.

@dweindl
Copy link
Member

dweindl commented Oct 19, 2020

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- pypesto/visualize/optimization_stats.py  10
         

Clones added
============
- pypesto/visualize/optimization_stats.py  6
         

See the complete overview on Codacy

pypesto/visualize/misc.py Outdated Show resolved Hide resolved
'n_sres']

if colors is None:
colors = assign_colors_for_list(len(properties_to_plot))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice you re-use the assign_colors logic here. Well done!



def optimization_run_properties_one_plot(
results: Result,
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to allow an iterable of results here as well, as the lower-level routine does ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Would it be one plot per result then? In all other cases plots for different results are plotted in one figure. In this case, multiple optimization properties for different results all in one figure would be too much, I think. So I didn't allow it :)

The plot axes.


Examples
Copy link
Contributor

Choose a reason for hiding this comment

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

That's nice!

"""

if properties_to_plot is None:
properties_to_plot = ['time', 'n_fval', 'n_grad', 'n_hess', 'n_res',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you really need that? If this routine is the lowlevel and only called via the high-level, you wouldn't need it, right?
So: do you want to expose this function to the outside world?

Copy link
Member Author

@plakrisenko plakrisenko Nov 10, 2020

Choose a reason for hiding this comment

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

I want to expose it. It can be used if one wants one figure per optimization property. Especially if there are multiple results. It will be, e.g. a figure with 'time' stats for all the results, a figure with 'n_fval' stats and so on

properties_to_plot = ['time', 'n_fval', 'n_grad', 'n_hess', 'n_res',
'n_sres']

# TODO: check color and legend shape
Copy link
Contributor

Choose a reason for hiding this comment

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

Well, as the name says ;)


# axes
if axes is None:
ncols = 2 if plot_type == 'both' else 1
Copy link
Contributor

Choose a reason for hiding this comment

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

As I see this...
How will the logic for "both" work, if you specify an existing axes object?

# loop over results
for j, result in enumerate(results):
if plot_type == 'both':
axes[0] = stats_lowlevel(result, opt_run_property,
Copy link
Contributor

Choose a reason for hiding this comment

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

ah, okay. So "both" will only really work with two subplots...
Would it make sense to double-check that beforehand? Not sure actually... If the user employs optional features, he/she should make sure to do that properly, maybe... So not sure whether extra double-checking is necessary...

'point. Stopping.')
if fval is not None:
self.fval = fval
else:
raise ValueError('Objective value fval not passed, but is a '
'manadatory input when creating a reference '
'mandatory input when creating a reference '
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for correcting my typos! 😄

@plakrisenko plakrisenko merged commit 51ce97e into develop Nov 10, 2020
@plakrisenko plakrisenko deleted the pl_visualization branch November 10, 2020 16:34
@yannikschaelte yannikschaelte mentioned this pull request Jan 19, 2021
m-philipps pushed a commit that referenced this pull request Jun 14, 2022
* Doc: Add 'scope' section and illustration of PEtab components

* Image to figure, add caption, update references

* fixup
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.

5 participants