pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
20.54k stars 3.57k forks source link

from_smiles should allow setting y (label) #9354

Closed j-adamczyk closed 1 month ago

j-adamczyk commented 1 month ago

🚀 The feature, motivation and pitch

Currently from_smiles (https://pytorch-geometric.readthedocs.io/en/latest/modules/utils.html#torch_geometric.utils.from_smiles) does not allow setting y (label). It should take such an argument, and pass it to Data it creates.

Alternatives

No response

Additional context

No response

rusty1s commented 1 month ago

The current design idea is to add labels afterwards. Does that work in your case?

j-adamczyk commented 1 month ago

I was getting a warning about y not being settable from PyCharm, but it went away after updating PyG. Probably due to @property for y being present, but not @y.setter. Anyway, it works, so I'm closing the issue