SMTG-Bham / ThermoParser

A tool for streamlining data analysis and visualisation for thermoelectrics and charge carrier transport in computational materials science.
https://smtg-bham.github.io/ThermoParser/
GNU Affero General Public License v3.0
46 stars 14 forks source link

[joss review] Gallery #85

Closed fnattino closed 7 months ago

fnattino commented 7 months ago

In the gallery I have found few examples that do not run as they are provided. Some examples:

JOSS review issue

kbspooner commented 7 months ago

These updates are currently in the bug-fix branch.

fnattino commented 7 months ago

Thanks, where and how the additional data can be downloaded is clearer now. Also thanks for fixing the issues above.

I still have some troubles running some of the commands via the CLI, I list the issues that I get here. Could you please have a look?

1. Heatmaps

Running the following command:

tp plot ztmap ../data/zno/boltztrap.hdf5 -k ../data/zno/kappa-m404021.hdf5 -c '#800080' -d x --discrete

Leads to:

``` Traceback (most recent call last): File "/opt/miniconda3/envs/ThermoParser/bin/tp", line 8, in sys.exit(tp_cli()) ^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/tp/cli/cli.py", line 2265, in ztmap tp.plot.heatmap.add_ztmap(ax, edata, kdata=kdata, direction=direction, File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/tp/plot/heatmap.py", line 715, in add_ztmap cbar = add_heatmap(ax, data['temperature'], list(np.abs(data['doping'])), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/tp/plot/heatmap.py", line 254, in add_heatmap levels = int(levels[0]) ^^^^^^^^^^^^^^ TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' ```

Also note there is one backtick "`" at the beginning of the command line in the docs.

Also the command below:

tp plot kappa-target ../data/zno/boltztrap.hdf5 -c '#008080' -d x

Gives this error:

``` Traceback (most recent call last): File "/opt/miniconda3/envs/ThermoParser/bin/tp", line 8, in sys.exit(tp_cli()) ^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/tp/cli/cli.py", line 1467, in kappa_target cbar = tp.plot.heatmap.add_kappa_target(ax, edata, zt=zt, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/tp/plot/heatmap.py", line 1020, in add_kappa_target cbar = add_heatmap(ax, data['temperature'], list(np.abs(data['doping'])), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/tp/plot/heatmap.py", line 304, in add_heatmap cbar.ax.axhline(c, color=contourcolours[i], **contourkwargs) File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 784, in axhline scaley = (yy < ymin) or (yy > ymax) ^^^^^^^^^ TypeError: '>' not supported between instances of 'float' and 'NoneType' ```

2. Phonons

In the following command one of the --doscolour option is missing one "-":

tp plot phonons ../data/zno/band.yaml --dos ../data/zno/projected_dos.dat --poscar ../data/zno/POSCAR -doscolour '#d46ef9' --doscolour '#7b8eff' -c '#f0901f'

3. Waterfall

The following command:

tp plot waterfall ../data/basno3/kappa-m363636.hdf5 -y mfp --projected kappa

Gives the following error:

``` Using 300.0 K. Traceback (most recent call last): File "/opt/miniconda3/envs/ThermoParser/bin/tp", line 8, in sys.exit(tp_cli()) ^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/tp/cli/cli.py", line 2104, in waterfall cbar = tp.plot.frequency.add_projected_waterfall(ax, data, y, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/ThermoParser/lib/python3.11/site-packages/tp/plot/frequency.py", line 896, in add_projected_waterfall cbar.draw_all() ^^^^^^^^^^^^^ AttributeError: 'Colorbar' object has no attribute 'draw_all'. Did you mean: '_draw_all'? ```
kbspooner commented 7 months ago

Thanks for catching these! All are now fixed. Not sure why the last one works for me and not you, but the suggested change has the same effect and if it makes it more robust that must be a good thing.

fnattino commented 7 months ago

Thanks - I can confirm they all work now!