InfectionMedicineProteomics / BINN

Generating biologically informed neural networks
https://infectionmedicineproteomics.github.io/BINN/
MIT License
25 stars 10 forks source link

max() arg is an empty sequence #42

Open ShivaAryal opened 6 months ago

ShivaAryal commented 6 months ago

I am getting error when I run

IG.plot_complete_sankey(
    multiclass=False, savename="complete_sankey.png", node_cmap="Accent_r", edge_cmap="Accent_r"
)

All the code above this works absolutely fine except this one.

The full error is

ValueError                                Traceback (most recent call last)
[<ipython-input-81-c16ece23224b>](https://localhost:8080/#) in <cell line: 1>()
----> 1 IG.plot_complete_sankey(
      2     multiclass=False, savename="complete_sankey.png", node_cmap="Accent_r", edge_cmap="Accent_r"
      3 )

2 frames
[/usr/local/lib/python3.10/dist-packages/binn/plot.py](https://localhost:8080/#) in get_node_positions(feature_labels, df)
    296             layer_df["y"] = (
    297                 0.8
--> 298                 * (0.01 + max(layer_df["rank"]) - layer_df["rank"])
    299                 / (max(layer_df["rank"]))
    300                 - 0.05

ValueError: max() arg is an empty sequence
ibishof-seer commented 6 months ago

I am getting the same error.

ErikHartman commented 5 months ago

I cannot reproduce your error locally, however, I've troubleshot another dataset on a different machine and got the same error. It should be fixed in #44

Can you pull that PR and see if it fixes your problem?