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.
Describe the bug Because a
Detector
class namedIceCube86
exists both undergraphnet.models.detectors.icecube
andgraphnet.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
Full traceback Please include the full error message to allow for debugging
Additional context As more detectors and experiments are added, we should probably set up a unit test to check for this.