From a330b22d66fad27935b23ab304189e439d4085a0 Mon Sep 17 00:00:00 2001 From: Tamas Gal <himself@tamasgal.com> Date: Wed, 7 Feb 2024 08:36:53 +0100 Subject: [PATCH] Make black --- doc/conf.py | 2 ++ examples/plot_offline_events.py | 1 + examples/plot_offline_tracks.py | 1 + examples/plot_offline_usr.py | 1 + examples/plot_online_example.py | 1 + src/km3io/__init__.py | 2 ++ src/km3io/acoustics.py | 1 + src/km3io/rootio.py | 2 +- 8 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 5f5dc98..78d088f 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 26d7c73..bf91e66 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 98cebbf..d4081ba 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 8bf3b2d..2129ad0 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 c735b12..ade4f4f 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 0733d17..87319be 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 73e25c8..59031dc 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 2b1648f..6133fca 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] -- GitLab