alchemistry / flamel

A free energy command line tool using alchemlyb
BSD 3-Clause "New" or "Revised" License
14 stars 3 forks source link

`flamel` fails the first time I ran it #28

Closed sidneypaulymer closed 2 months ago

sidneypaulymer commented 2 months ago

Hi flamel team,

I just tried this tool for the first time today, but it fails with the following error:

2024-07-03 11:22:23.361 | INFO     | alchemlyb.workflows.abfe:plot_ti_dhdl:661 - Plot TI dHdl.
Traceback (most recent call last):
  File "/Users/sid/mambaforge/envs/pymbar/bin/flamel", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/sid/mambaforge/envs/pymbar/lib/python3.12/site-packages/flamel/flamel.py", line 200, in main
    workflow.run(
  File "/Users/sid/mambaforge/envs/pymbar/lib/python3.12/site-packages/alchemlyb/workflows/abfe.py", line 284, in run
    ax = self.plot_ti_dhdl()
         ^^^^^^^^^^^^^^^^^^^
  File "/Users/sid/mambaforge/envs/pymbar/lib/python3.12/site-packages/alchemlyb/workflows/abfe.py", line 663, in plot_ti_dhdl
    ax = plot_ti_dhdl(
         ^^^^^^^^^^^^^
  File "/Users/sid/mambaforge/envs/pymbar/lib/python3.12/site-packages/alchemlyb/visualisation/ti_dhdl.py", line 225, in plot_ti_dhdl
    for l in lege.legendHandles:
             ^^^^^^^^^^^^^^^^^^
AttributeError: 'Legend' object has no attribute 'legendHandles'. Did you mean: 'legend_handles'?

I just installed everything today, so all packages should be up-to-date:

# Name                    Version                   Build  Channel
alchemistry-flamel        0.3.1                    pypi_0    pypi
alchemlyb                 2.3.0              pyhd8ed1ab_0    conda-forge
{...snip...}
pymbar                    4.0.3                h1f38498_1    conda-forge
pymbar-core               4.0.3           py312hf635c46_1    conda-forge
...
python                    3.12.4          h30c5eda_0_cpython    conda-forge

And this is the command line: $ flamel -d flamel -g -j res.txt -o flamel/results -p Ethanol -q dhdl.xvg -s 1000 -t 298 -u 'kJ/mol' -v

Thank you in advance for your help!

sidneypaulymer commented 2 months ago

Hmm, I just tried the fix suggested in the error message and it fixed it!

>>> ti_dhdl.py (alchemlyb)
224     lege = ax.legend(prop=FP(size=14), frameon=False, loc=1)
225     #for l in lege.legendHandles:
226     for l in lege.legend_handles:
227         l.set_linewidth(10)
xiki-tempula commented 2 months ago

Yes. I found this as well. Need to fix this in alchemlyb.

xiki-tempula commented 2 months ago

@sidneypaulymer Do you mind give https://github.com/alchemistry/alchemlyb/pull/377 a review? Like approve the PR so I will merge it tomorrow morning.

sidneypaulymer commented 2 months ago

@xiki-tempula Left a comment in the PR. Thanks for the quick response!