Closed pfebrer closed 5 months ago
Attention: Patch coverage is 35.00000%
with 13 lines
in your changes are missing coverage. Please review.
Project coverage is 86.74%. Comparing base (
0b964fe
) to head (499feb6
).
Files | Patch % | Lines |
---|---|---|
src/sisl/viz/figure/matplotlib.py | 28.57% | 5 Missing :warning: |
src/sisl/viz/plot.py | 16.66% | 5 Missing :warning: |
src/sisl/viz/figure/plotly.py | 50.00% | 2 Missing :warning: |
src/sisl/viz/figure/figure.py | 66.66% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@pfebrer could you have a look in the latest build (I just tried to rebuild), I got this: https://github.com/zerothi/sisl/actions/runs/8799290553/job/24148053929
Can you see the output?
CellExecutionError in tutorials/tutorial_es_1.ipynb:
------------------
coord = graphene.sub(0)
coord.plot(axes="xy", atoms_style={"color": "red"}).merge(
graphene.remove(0).plot(axes="xy")
)
------------------
----- stdout -----
plot_actions False
------------------
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[5], line 2
1 coord = graphene.sub(0)
----> 2 coord.plot(axes="xy", atoms_style={"color": "red"}).merge(
3 graphene.remove(0).plot(axes="xy")
4 )
File /opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/sisl/viz/plot.py:40, in Plot.merge(self, *others, **kwargs)
37 def merge(self, *others, **kwargs):
38 from .plots.merged import merge_plots
---> 40 return merge_plots(self, *others, **kwargs)
File /opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/sisl/viz/plots/merged.py:44, in merge_plots(composite_method, backend, *figures, **kwargs)
40 plot.get()
41 return plot
43 plot_actions = combined(
---> 44 *[_san_plot(fig).plot_actions for fig in figures],
45 composite_method=composite_method,
46 **kwargs,
47 )
49 return get_figure(plot_actions=plot_actions, backend=backend)
File /opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/sisl/viz/plot.py:31, in Plot.__getattr__(self, key)
29 return getattr(self.nodes.output.get(), key)
30 else:
---> 31 raise AttributeError(
32 f"'{key}' not found in {self.__class__.__name__} with backend '{selected_backend}'"
33 )
34 else:
35 return super().__getattr__(key)
AttributeError: 'plot_actions' not found in GeometryPlot with backend 'plotly'
You can ignore this error by setting the following in conf.py:
nbsphinx_allow_errors = True
make: *** [Makefile:22: html] Error 2
Error: Process completed with exit code 2.
With this PR plots are updated if one attempts to retreive an attribute that we know will be present in the figure.
This is to make things like
plot.show()
even when no plot has been computed yet. It was not intuitive for users that you had toplot.get().show()
. This has the side effect thatplot.show()
will now update the plot.This means that the way of acting on the plot without updating it now is by getting the_output
attribute. E.g. to show the current (possibly outdated) plot:It fixes the broken docs.