diff --git a/doc/conf.py b/doc/conf.py index 5f5dc986c516efbdb96b407d31137105c40e4fdf..78d088f5ccff25999b0b69cbb476a5563cf13d6c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -22,9 +22,11 @@ from pkg_resources import get_distribution # -- Project information ----------------------------------------------------- try: from importlib.metadata import version as get_version + version = get_version("km3io") except ImportError: from pkg_resources import get_distribution + version = get_distribution("km3io").version short_version = ".".join(version.split(".")[:2]) diff --git a/examples/plot_offline_events.py b/examples/plot_offline_events.py index 26d7c7331121e030f1118129d80c36f8a79fd6e3..bf91e669f3213007da966754e89e073c60894add 100644 --- a/examples/plot_offline_events.py +++ b/examples/plot_offline_events.py @@ -8,6 +8,7 @@ written by aanet software. Note: the offline file used here has MC offline data and was intentionaly reduced to 10 events. """ + import km3io as ki from km3net_testdata import data_path diff --git a/examples/plot_offline_tracks.py b/examples/plot_offline_tracks.py index 98cebbfa6d729d6f2e6af6f65a7b69c75f2e5429..d4081baf6d7525789f9e68edbc106fecb400f121 100644 --- a/examples/plot_offline_tracks.py +++ b/examples/plot_offline_tracks.py @@ -6,6 +6,7 @@ The following example shows how to access tracks data in an offline ROOT file. Note: the offline files used here were intentionaly reduced to 10 events. """ + import km3io as ki from km3net_testdata import data_path diff --git a/examples/plot_offline_usr.py b/examples/plot_offline_usr.py index 8bf3b2d16fa9686fc7e9502b48930480f35130c5..2129ad0976c71c1e5eb24417b487ccc832d9fd2c 100644 --- a/examples/plot_offline_usr.py +++ b/examples/plot_offline_usr.py @@ -7,6 +7,7 @@ like a dictionary and returns ``lazyarray``, compatible to the ``numpy.array`` interface. The available keys can be accessed either as attributes or via a dictionary lookup: """ + import km3io as ki from km3net_testdata import data_path diff --git a/examples/plot_online_example.py b/examples/plot_online_example.py index c735b128b0254e7e1719e0d3891844d749a8e253..ade4f4f60dd1cf4e644f09b61e4e8927d27eeab0 100644 --- a/examples/plot_online_example.py +++ b/examples/plot_online_example.py @@ -8,6 +8,7 @@ from the detector and written by the `JDataWriter` application. Such a file is usually called "KM3NET_00000001_00000002.root", where the first number is the detector ID and the second the run number. """ + import km3io as ki from km3net_testdata import data_path diff --git a/src/km3io/__init__.py b/src/km3io/__init__.py index 0733d17aa1ac32e052f4c38d8f642fc9861c5d7f..87319be5305dadc56ea53cb79e7b9e3b99c948b8 100644 --- a/src/km3io/__init__.py +++ b/src/km3io/__init__.py @@ -1,8 +1,10 @@ try: from importlib.metadata import version as get_version + version = get_version(__name__) except ImportError: from pkg_resources import get_distribution + version = get_distribution(__name__).version diff --git a/src/km3io/acoustics.py b/src/km3io/acoustics.py index 73e25c80da544b9eab5d17a7535e8ffd32da959f..59031dc2334804aad48dec4fceec482e835ec9e3 100644 --- a/src/km3io/acoustics.py +++ b/src/km3io/acoustics.py @@ -41,6 +41,7 @@ tentatively dealt with. WARNING: data should be in general expected as ordered but may not be contiguous in time. """ + import numpy as np diff --git a/src/km3io/rootio.py b/src/km3io/rootio.py index 2b1648f782d204118152e5ebe5c302587a0c5e3c..6133fca4607749a3d7f46a7680722feaeb59e304 100644 --- a/src/km3io/rootio.py +++ b/src/km3io/rootio.py @@ -261,7 +261,7 @@ class EventReader: data = {} for k in keys: data[k] = _event[k] - for (k, i) in zip(nested_keys, nested_items): + for k, i in zip(nested_keys, nested_items): data[k] = i for tokey, fromkey in self.nested_aliases.items(): data[tokey] = data[fromkey]