benedekrozemberczki / pytorch_geometric_temporal

PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models (CIKM 2021)
MIT License
2.62k stars 369 forks source link

__get_item__ or __getitem__ #132

Closed josephenguehard closed 2 years ago

josephenguehard commented 2 years ago

Hi,

Thanks for this very nice library! I was just wandering, is there a reason for using __get_item__ instead of the magic method __getitem__ in the Signal? For instance here: https://github.com/benedekrozemberczki/pytorch_geometric_temporal/blob/90fc89e233fd3fd6117bcd7b5746819c496bc980/torch_geometric_temporal/signal/static_graph_temporal_signal.py#L103

Using __getitem__ would allow the user to get a snapshot directly by calling, for instance, dataset[0].

benedekrozemberczki commented 2 years ago

Hi there @josephenguehard! Do you want to open a PR with refactoring the getitem methods in the signals?

josephenguehard commented 2 years ago

Sounds good, will do it later today!