graphnet-team / graphnet

A Deep learning library for neutrino telescopes
https://graphnet-team.github.io/graphnet/
Apache License 2.0
85 stars 85 forks source link

Rename `Detector` classes in `graphnet.models.detector.prometheus` #705

Closed RasmusOrsoe closed 2 months ago

RasmusOrsoe commented 2 months ago

Describe the bug Because a Detector class named IceCube86 exists both under graphnet.models.detectors.icecube and graphnet.models.detectors.prometheus, warnings are thrown when building a model from a configuration file.

To Reproduce Steps to reproduce the behavior:

Run the following on current main

from graphnet.models import Model

model = Model.from_config("model.yml")
model = model.load_state_dict("model_weights.pth")

Full traceback Please include the full error message to allow for debugging

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:26 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:27 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:27 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:27 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:27 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.icecube.IceCube86'> and <class 'graphnet.models.detector.prometheus.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:27 - get_all_grapnet_classes - Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

WARNING:graphnet:Class IceCube86 found in both <class 'graphnet.models.detector.prometheus.IceCube86'> and <class 'graphnet.models.detector.icecube.IceCube86'>. Keeping first instance. Consider renaming.

graphnet [MainProcess] WARNING  2024-05-03 09:04:27 - filter - Will not print the below message again (20 repeats reached).

WARNING:graphnet:Will not print the below message again (20 repeats reached).

Additional context As more detectors and experiments are added, we should probably set up a unit test to check for this.