From 7d0f4acf1f9dfc3376f963ee837650bb42459f1f Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 22 Nov 2023 14:38:41 -0600 Subject: [PATCH 1/2] configure ruff to import annotations --- .pre-commit-config.yaml | 2 +- pyproject.toml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f882ac07..2c29ec7dc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.6 hooks: - id: ruff args: [--fix, --show-fixes] diff --git a/pyproject.toml b/pyproject.toml index 23c34eb93..b2fdfd661 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -141,6 +141,9 @@ select = [ ] src = ["src"] +[tool.ruff.lint] +isort.required-imports = ["from __future__ import annotations"] + [tool.ruff.mccabe] max-complexity = 100 From 2ce6d8355f96e094ff82d152029476a72d879580 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:40:48 +0000 Subject: [PATCH 2/2] style: pre-commit fixes --- dev/example-objects.py | 1 + dev/make-models.py | 1 + src/uproot/_awkward_forth.py | 1 + src/uproot/behavior.py | 2 +- src/uproot/behaviors/RooCurve.py | 2 +- src/uproot/behaviors/RooHist.py | 2 +- src/uproot/behaviors/TAxis.py | 2 +- src/uproot/behaviors/TBranch.py | 2 +- src/uproot/behaviors/TBranchElement.py | 2 +- src/uproot/behaviors/TDatime.py | 2 +- src/uproot/behaviors/TGraph.py | 2 +- src/uproot/behaviors/TGraphAsymmErrors.py | 2 +- src/uproot/behaviors/TGraphErrors.py | 1 + src/uproot/behaviors/TH1.py | 2 +- src/uproot/behaviors/TH2.py | 2 +- src/uproot/behaviors/TH2Poly.py | 2 +- src/uproot/behaviors/TH3.py | 2 +- src/uproot/behaviors/TParameter.py | 1 + src/uproot/behaviors/TProfile.py | 2 +- src/uproot/behaviors/TProfile2D.py | 2 +- src/uproot/behaviors/TProfile3D.py | 2 +- src/uproot/behaviors/TTree.py | 2 +- src/uproot/cache.py | 2 +- src/uproot/const.py | 1 + src/uproot/containers.py | 2 +- src/uproot/deserialization.py | 2 +- src/uproot/dynamic.py | 1 + src/uproot/exceptions.py | 1 + src/uproot/extras.py | 1 + src/uproot/interpretation/__init__.py | 1 + src/uproot/interpretation/grouped.py | 2 +- src/uproot/interpretation/identify.py | 2 +- src/uproot/interpretation/jagged.py | 2 +- src/uproot/interpretation/library.py | 2 +- src/uproot/interpretation/numerical.py | 2 +- src/uproot/interpretation/objects.py | 1 + src/uproot/interpretation/strings.py | 1 + src/uproot/language/__init__.py | 1 + src/uproot/language/python.py | 2 +- src/uproot/model.py | 2 +- src/uproot/models/RNTuple.py | 1 + src/uproot/models/TArray.py | 2 +- src/uproot/models/TAtt.py | 2 +- src/uproot/models/TBasket.py | 2 +- src/uproot/models/TBranch.py | 2 +- src/uproot/models/TClonesArray.py | 2 +- src/uproot/models/TDatime.py | 2 +- src/uproot/models/TGraph.py | 2 +- src/uproot/models/TH.py | 2 +- src/uproot/models/THashList.py | 2 +- src/uproot/models/TLeaf.py | 2 +- src/uproot/models/TList.py | 2 +- src/uproot/models/TMatrixT.py | 2 +- src/uproot/models/TNamed.py | 2 +- src/uproot/models/TObjArray.py | 2 +- src/uproot/models/TObjString.py | 2 +- src/uproot/models/TObject.py | 2 +- src/uproot/models/TRef.py | 2 +- src/uproot/models/TString.py | 2 +- src/uproot/models/TTable.py | 2 +- src/uproot/models/TTree.py | 2 +- src/uproot/pyroot.py | 2 +- src/uproot/reading.py | 1 + src/uproot/serialization.py | 2 +- src/uproot/streamers.py | 1 + src/uproot/version.py | 2 +- src/uproot/writing/__init__.py | 2 +- src/uproot/writing/_cascade.py | 2 +- src/uproot/writing/_cascadentuple.py | 2 +- src/uproot/writing/_cascadetree.py | 2 +- src/uproot/writing/identify.py | 1 + 71 files changed, 71 insertions(+), 54 deletions(-) diff --git a/dev/example-objects.py b/dev/example-objects.py index 0902144c1..a06ada88b 100644 --- a/dev/example-objects.py +++ b/dev/example-objects.py @@ -1,6 +1,7 @@ """ Use this to make an example ROOT file for src/uproot/models/TH.py and src/uproot/models/TGraph.py. """ +from __future__ import annotations import numpy as np import ROOT diff --git a/dev/make-models.py b/dev/make-models.py index fc6f73ce4..8f9895e92 100644 --- a/dev/make-models.py +++ b/dev/make-models.py @@ -1,6 +1,7 @@ """ Use this to make src/uproot/models/TH.py and src/uproot/models/TGraph.py. """ +from __future__ import annotations import numpy as np diff --git a/src/uproot/_awkward_forth.py b/src/uproot/_awkward_forth.py index 8c841978a..b1ad6985e 100644 --- a/src/uproot/_awkward_forth.py +++ b/src/uproot/_awkward_forth.py @@ -3,6 +3,7 @@ """ This module defines utilities for adding components to the forth reader. """ +from __future__ import annotations import numpy as np diff --git a/src/uproot/behavior.py b/src/uproot/behavior.py index b87002ad3..ec13ab843 100644 --- a/src/uproot/behavior.py +++ b/src/uproot/behavior.py @@ -5,7 +5,7 @@ Behaviors are defined by specially named classes in specially named modules that get auto-detected by :doc:`uproot.behavior.behavior_of`. """ - +from __future__ import annotations import pkgutil diff --git a/src/uproot/behaviors/RooCurve.py b/src/uproot/behaviors/RooCurve.py index 60f332cc5..f9d36b21d 100644 --- a/src/uproot/behaviors/RooCurve.py +++ b/src/uproot/behaviors/RooCurve.py @@ -3,7 +3,7 @@ """ This module defines the behaviors of ``RooCurve``. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/RooHist.py b/src/uproot/behaviors/RooHist.py index d14e02b08..e490f0cd7 100644 --- a/src/uproot/behaviors/RooHist.py +++ b/src/uproot/behaviors/RooHist.py @@ -3,7 +3,7 @@ """ This module defines the behaviors of ``RooHist``. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TAxis.py b/src/uproot/behaviors/TAxis.py index 4b1015278..e45e05a73 100644 --- a/src/uproot/behaviors/TAxis.py +++ b/src/uproot/behaviors/TAxis.py @@ -3,7 +3,7 @@ """ This module defines the behaviors of ``TAxis``, an axis of a histogram or profile plot. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TBranch.py b/src/uproot/behaviors/TBranch.py index 0d3372e09..617da2e00 100644 --- a/src/uproot/behaviors/TBranch.py +++ b/src/uproot/behaviors/TBranch.py @@ -10,7 +10,7 @@ See :doc:`uproot.models.TBranch` for deserialization of the ``TBranch`` objects themselves. """ - +from __future__ import annotations import queue import re diff --git a/src/uproot/behaviors/TBranchElement.py b/src/uproot/behaviors/TBranchElement.py index b87da1e45..8630a63e6 100644 --- a/src/uproot/behaviors/TBranchElement.py +++ b/src/uproot/behaviors/TBranchElement.py @@ -4,7 +4,7 @@ This module defines the behaviors of ``TBranchElement``, which is entirely inherited from functions in :doc:`uproot.behaviors.TBranch.TBranch`. """ - +from __future__ import annotations import uproot diff --git a/src/uproot/behaviors/TDatime.py b/src/uproot/behaviors/TDatime.py index f9a466e4c..f2ef6a814 100644 --- a/src/uproot/behaviors/TDatime.py +++ b/src/uproot/behaviors/TDatime.py @@ -3,7 +3,7 @@ """ This module defines the behaviors of ``TDatime``. """ - +from __future__ import annotations import uproot diff --git a/src/uproot/behaviors/TGraph.py b/src/uproot/behaviors/TGraph.py index e6d790f4c..efca2dd7f 100644 --- a/src/uproot/behaviors/TGraph.py +++ b/src/uproot/behaviors/TGraph.py @@ -3,7 +3,7 @@ """ This module defines the behaviors of ``TGraph``. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TGraphAsymmErrors.py b/src/uproot/behaviors/TGraphAsymmErrors.py index 30fb7c09e..febc4db52 100644 --- a/src/uproot/behaviors/TGraphAsymmErrors.py +++ b/src/uproot/behaviors/TGraphAsymmErrors.py @@ -3,7 +3,7 @@ """ This module defines the behaviors of ``TGraphAsymmErrors``. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TGraphErrors.py b/src/uproot/behaviors/TGraphErrors.py index ab941882a..cb4995b31 100644 --- a/src/uproot/behaviors/TGraphErrors.py +++ b/src/uproot/behaviors/TGraphErrors.py @@ -3,6 +3,7 @@ """ This module defines the behaviors of ``TGraphErrors``. """ +from __future__ import annotations class TGraphErrors: diff --git a/src/uproot/behaviors/TH1.py b/src/uproot/behaviors/TH1.py index 2c519598f..b9d24f7f1 100644 --- a/src/uproot/behaviors/TH1.py +++ b/src/uproot/behaviors/TH1.py @@ -4,7 +4,7 @@ This module defines the behaviors of ``TH1`` and its subclasses (not including ``TH2``, ``TH3``, or ``TProfile``). """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TH2.py b/src/uproot/behaviors/TH2.py index 2392ddfe5..913272bc6 100644 --- a/src/uproot/behaviors/TH2.py +++ b/src/uproot/behaviors/TH2.py @@ -4,7 +4,7 @@ This module defines the behaviors of ``TH2`` and its subclasses (not including ``TProfile2D`` and ``TH2Poly``). """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TH2Poly.py b/src/uproot/behaviors/TH2Poly.py index 7e7f9cee6..baa2dfb6a 100644 --- a/src/uproot/behaviors/TH2Poly.py +++ b/src/uproot/behaviors/TH2Poly.py @@ -3,7 +3,7 @@ """ This module defines the behavior of ``TH2Poly``. """ - +from __future__ import annotations import uproot diff --git a/src/uproot/behaviors/TH3.py b/src/uproot/behaviors/TH3.py index 34d0e3c04..fd1ea64e3 100644 --- a/src/uproot/behaviors/TH3.py +++ b/src/uproot/behaviors/TH3.py @@ -4,7 +4,7 @@ This module defines the behaviors of ``TH3`` and its subclasses (not including ``TProfile3D``). """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TParameter.py b/src/uproot/behaviors/TParameter.py index 5ad8c8a67..eb71f8714 100644 --- a/src/uproot/behaviors/TParameter.py +++ b/src/uproot/behaviors/TParameter.py @@ -3,6 +3,7 @@ """ This module defines the behavior of ``TParameter``. """ +from __future__ import annotations class TParameter_3c_boolean_3e_: diff --git a/src/uproot/behaviors/TProfile.py b/src/uproot/behaviors/TProfile.py index 9a3371c44..c9855552e 100644 --- a/src/uproot/behaviors/TProfile.py +++ b/src/uproot/behaviors/TProfile.py @@ -3,7 +3,7 @@ """ This module defines the behavior of ``TProfile``. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TProfile2D.py b/src/uproot/behaviors/TProfile2D.py index 266960a9d..b1494a3f6 100644 --- a/src/uproot/behaviors/TProfile2D.py +++ b/src/uproot/behaviors/TProfile2D.py @@ -3,7 +3,7 @@ """ This module defines the behavior of ``TProfile2D``. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TProfile3D.py b/src/uproot/behaviors/TProfile3D.py index 364368508..b26d9fd39 100644 --- a/src/uproot/behaviors/TProfile3D.py +++ b/src/uproot/behaviors/TProfile3D.py @@ -3,7 +3,7 @@ """ This module defines the behavior of ``TProfile3D``. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/behaviors/TTree.py b/src/uproot/behaviors/TTree.py index b2c7f1b2c..24dd96c77 100644 --- a/src/uproot/behaviors/TTree.py +++ b/src/uproot/behaviors/TTree.py @@ -4,7 +4,7 @@ This module defines the behaviors of ``TTree``, which is almost entirely inherited from functions in :doc:`uproot.behaviors.TBranch`. """ - +from __future__ import annotations import uproot diff --git a/src/uproot/cache.py b/src/uproot/cache.py index 04c59f2cb..161b7a9b9 100644 --- a/src/uproot/cache.py +++ b/src/uproot/cache.py @@ -11,7 +11,7 @@ The :doc:`uproot.cache.LRUArrayCache` implements the same policy, limiting the total number of bytes, as reported by ``nbytes``. """ - +from __future__ import annotations import threading from collections.abc import MutableMapping diff --git a/src/uproot/const.py b/src/uproot/const.py index 0d4424b5a..2bb9e067f 100644 --- a/src/uproot/const.py +++ b/src/uproot/const.py @@ -3,6 +3,7 @@ """ This module defines integer constants used by serialization and deserialization routines. """ +from __future__ import annotations import struct diff --git a/src/uproot/containers.py b/src/uproot/containers.py index 75f6cbbf3..fecc5055e 100644 --- a/src/uproot/containers.py +++ b/src/uproot/containers.py @@ -6,7 +6,7 @@ See :doc:`uproot.interpretation` and :doc:`uproot.model`. """ - +from __future__ import annotations import json import struct diff --git a/src/uproot/deserialization.py b/src/uproot/deserialization.py index 57642a1d5..6629facf6 100644 --- a/src/uproot/deserialization.py +++ b/src/uproot/deserialization.py @@ -7,7 +7,7 @@ :doc:`uproot.deserialization.read_object_any`, which manages references to previously read objects. """ - +from __future__ import annotations import struct import sys diff --git a/src/uproot/dynamic.py b/src/uproot/dynamic.py index 7ed0b06dd..89ac51024 100644 --- a/src/uproot/dynamic.py +++ b/src/uproot/dynamic.py @@ -12,6 +12,7 @@ classes, which are used as a container in which data from pickled :doc:`uproot.model.VersionedModel` instances are filled. """ +from __future__ import annotations def __getattr__(name): diff --git a/src/uproot/exceptions.py b/src/uproot/exceptions.py index 59a22c569..a27f274f2 100644 --- a/src/uproot/exceptions.py +++ b/src/uproot/exceptions.py @@ -4,6 +4,7 @@ This module defines Uproot-specific exceptions, such as :doc:`uproot.exceptions.KeyInFileError`. """ +from __future__ import annotations import uproot diff --git a/src/uproot/extras.py b/src/uproot/extras.py index 7d8657d4e..09f8d7571 100644 --- a/src/uproot/extras.py +++ b/src/uproot/extras.py @@ -7,6 +7,7 @@ If a library cannot be imported, these functions raise ``ModuleNotFoundError`` with error messages containing instructions on how to install the library. """ +from __future__ import annotations import atexit import importlib.metadata as importlib_metadata diff --git a/src/uproot/interpretation/__init__.py b/src/uproot/interpretation/__init__.py index 4c0510d37..3252958da 100644 --- a/src/uproot/interpretation/__init__.py +++ b/src/uproot/interpretation/__init__.py @@ -10,6 +10,7 @@ that determine the default interpretation of a :doc:`uproot.behaviors.TBranch.TBranch`. """ +from __future__ import annotations class Interpretation: diff --git a/src/uproot/interpretation/grouped.py b/src/uproot/interpretation/grouped.py index 233c6d70c..edf42d955 100644 --- a/src/uproot/interpretation/grouped.py +++ b/src/uproot/interpretation/grouped.py @@ -5,7 +5,7 @@ temporary array for grouped data; usually applied to a ``TBranch`` that does not contain data but has subbranches that do. """ - +from __future__ import annotations import uproot diff --git a/src/uproot/interpretation/identify.py b/src/uproot/interpretation/identify.py index 1be3bdb79..290da0fc5 100644 --- a/src/uproot/interpretation/identify.py +++ b/src/uproot/interpretation/identify.py @@ -11,7 +11,7 @@ observed in ROOT files (perhaps forever), unless a systematic study can be performed to exhaustively discover all cases. """ - +from __future__ import annotations import ast import numbers diff --git a/src/uproot/interpretation/jagged.py b/src/uproot/interpretation/jagged.py index e82c4628b..d5c858000 100644 --- a/src/uproot/interpretation/jagged.py +++ b/src/uproot/interpretation/jagged.py @@ -8,7 +8,7 @@ an array is being built from ``TBaskets``. Its final form is determined by :doc:`uproot.interpretation.library`. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/interpretation/library.py b/src/uproot/interpretation/library.py index 23b77dd16..4fed69919 100644 --- a/src/uproot/interpretation/library.py +++ b/src/uproot/interpretation/library.py @@ -21,7 +21,7 @@ Lazy arrays (:doc:`uproot.behaviors.TBranch.lazy`) can only use the :doc:`uproot.interpretation.library.Awkward` library. """ - +from __future__ import annotations import gc import json diff --git a/src/uproot/interpretation/numerical.py b/src/uproot/interpretation/numerical.py index 741f1f8db..de7ec7e6f 100644 --- a/src/uproot/interpretation/numerical.py +++ b/src/uproot/interpretation/numerical.py @@ -15,7 +15,7 @@ * :doc:`uproot.interpretation.numerical.AsSTLBits`: an ``std::bitset`` for some ``N``. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/interpretation/objects.py b/src/uproot/interpretation/objects.py index cd7ccb1f7..c73b910e5 100644 --- a/src/uproot/interpretation/objects.py +++ b/src/uproot/interpretation/objects.py @@ -18,6 +18,7 @@ while an array is being built from ``TBaskets``. Its final form is determined by the :doc:`uproot.interpretation.library.Library`. """ +from __future__ import annotations import contextlib import threading diff --git a/src/uproot/interpretation/strings.py b/src/uproot/interpretation/strings.py index e916dbb58..59afcdcb7 100644 --- a/src/uproot/interpretation/strings.py +++ b/src/uproot/interpretation/strings.py @@ -12,6 +12,7 @@ an array is being built from ``TBaskets``. Its final form is determined by the :doc:`uproot.interpretation.library.Library`. """ +from __future__ import annotations import struct import threading diff --git a/src/uproot/language/__init__.py b/src/uproot/language/__init__.py index 1eece6a3f..22d97c140 100644 --- a/src/uproot/language/__init__.py +++ b/src/uproot/language/__init__.py @@ -8,6 +8,7 @@ All languages must be subclasses of :doc:`uproot.language.Language`. """ +from __future__ import annotations class Language: diff --git a/src/uproot/language/python.py b/src/uproot/language/python.py index 8c0085ae6..6fb394d09 100644 --- a/src/uproot/language/python.py +++ b/src/uproot/language/python.py @@ -7,7 +7,7 @@ The :doc:`uproot.language.python.PythonLanguage` evaluates Python code. It is the default language. """ - +from __future__ import annotations import ast import warnings diff --git a/src/uproot/model.py b/src/uproot/model.py index 08a11b380..fbfa80516 100644 --- a/src/uproot/model.py +++ b/src/uproot/model.py @@ -16,7 +16,7 @@ not be modeled, either because the class has no streamer or no streamer for its version. """ - +from __future__ import annotations import re import sys diff --git a/src/uproot/models/RNTuple.py b/src/uproot/models/RNTuple.py index b3d4fe871..cd0f2dfda 100644 --- a/src/uproot/models/RNTuple.py +++ b/src/uproot/models/RNTuple.py @@ -3,6 +3,7 @@ """ This module defines a versionless model for ``ROOT::Experimental::RNTuple``. """ +from __future__ import annotations import struct import zlib diff --git a/src/uproot/models/TArray.py b/src/uproot/models/TArray.py index e25329e4a..5c4e227fd 100644 --- a/src/uproot/models/TArray.py +++ b/src/uproot/models/TArray.py @@ -3,7 +3,7 @@ """ This module defines versionless models for ``TArray`` and its subclasses. """ - +from __future__ import annotations import struct from collections.abc import Sequence diff --git a/src/uproot/models/TAtt.py b/src/uproot/models/TAtt.py index 479a407cb..04a92425b 100644 --- a/src/uproot/models/TAtt.py +++ b/src/uproot/models/TAtt.py @@ -3,7 +3,7 @@ """ This module defines versioned models for ``TAttLine``, ``TAttFill``, and ``TAttMarker``. """ - +from __future__ import annotations import struct diff --git a/src/uproot/models/TBasket.py b/src/uproot/models/TBasket.py index ee7bceb15..e65e5284b 100644 --- a/src/uproot/models/TBasket.py +++ b/src/uproot/models/TBasket.py @@ -7,7 +7,7 @@ Includes both "embedded" ``TBaskets`` (as a member of TBranch) and "free" ``TBaskets`` (top-level objects, located by ``TKeys``). """ - +from __future__ import annotations import struct diff --git a/src/uproot/models/TBranch.py b/src/uproot/models/TBranch.py index 289f6dae1..fca8d71f9 100644 --- a/src/uproot/models/TBranch.py +++ b/src/uproot/models/TBranch.py @@ -6,7 +6,7 @@ See :doc:`uproot.behaviors.TBranch` for definitions of ``TTree``-reading functions. """ - +from __future__ import annotations import struct diff --git a/src/uproot/models/TClonesArray.py b/src/uproot/models/TClonesArray.py index a87249b74..b77939ae7 100644 --- a/src/uproot/models/TClonesArray.py +++ b/src/uproot/models/TClonesArray.py @@ -3,7 +3,7 @@ """ This module defines a versionless model for ``TClonesArray``. """ - +from __future__ import annotations from collections.abc import Sequence diff --git a/src/uproot/models/TDatime.py b/src/uproot/models/TDatime.py index e16888238..1bd7cfc93 100644 --- a/src/uproot/models/TDatime.py +++ b/src/uproot/models/TDatime.py @@ -3,7 +3,7 @@ """ This module defines versioned models for ``TDatime``. """ - +from __future__ import annotations import struct diff --git a/src/uproot/models/TGraph.py b/src/uproot/models/TGraph.py index 0eb517983..5b5d489f0 100644 --- a/src/uproot/models/TGraph.py +++ b/src/uproot/models/TGraph.py @@ -3,7 +3,7 @@ """ This module defines versioned models for ``TLeaf`` and its subclasses. """ - +from __future__ import annotations import struct diff --git a/src/uproot/models/TH.py b/src/uproot/models/TH.py index 4916005c1..39d682b74 100644 --- a/src/uproot/models/TH.py +++ b/src/uproot/models/TH.py @@ -3,7 +3,7 @@ """ This module defines versioned models for ``TLeaf`` and its subclasses. """ - +from __future__ import annotations import struct diff --git a/src/uproot/models/THashList.py b/src/uproot/models/THashList.py index a74a6784d..dd12dff54 100644 --- a/src/uproot/models/THashList.py +++ b/src/uproot/models/THashList.py @@ -3,7 +3,7 @@ """ This module defines a versionless model for ``THashList``. """ - +from __future__ import annotations import uproot diff --git a/src/uproot/models/TLeaf.py b/src/uproot/models/TLeaf.py index 1c2f79834..dbf31df0c 100644 --- a/src/uproot/models/TLeaf.py +++ b/src/uproot/models/TLeaf.py @@ -3,7 +3,7 @@ """ This module defines versioned models for ``TLeaf`` and its subclasses. """ - +from __future__ import annotations import struct diff --git a/src/uproot/models/TList.py b/src/uproot/models/TList.py index 0a0f36383..906769125 100644 --- a/src/uproot/models/TList.py +++ b/src/uproot/models/TList.py @@ -3,7 +3,7 @@ """ This module defines a versionless model for ``TList``. """ - +from __future__ import annotations import struct from collections.abc import Sequence diff --git a/src/uproot/models/TMatrixT.py b/src/uproot/models/TMatrixT.py index e71422ddc..80a2666a8 100644 --- a/src/uproot/models/TMatrixT.py +++ b/src/uproot/models/TMatrixT.py @@ -3,7 +3,7 @@ """ This module defines versioned models for ``TLeaf`` and its subclasses. """ - +from __future__ import annotations import struct diff --git a/src/uproot/models/TNamed.py b/src/uproot/models/TNamed.py index 64cf2b8d5..a85f4a393 100644 --- a/src/uproot/models/TNamed.py +++ b/src/uproot/models/TNamed.py @@ -3,7 +3,7 @@ """ This module defines a versionless model for ``TNamed``. """ - +from __future__ import annotations import numpy diff --git a/src/uproot/models/TObjArray.py b/src/uproot/models/TObjArray.py index c2f010a81..41fc770ee 100644 --- a/src/uproot/models/TObjArray.py +++ b/src/uproot/models/TObjArray.py @@ -3,7 +3,7 @@ """ This module defines a versionless model for ``TObjArray``. """ - +from __future__ import annotations import struct from collections.abc import Sequence diff --git a/src/uproot/models/TObjString.py b/src/uproot/models/TObjString.py index a27e24332..70444c32d 100644 --- a/src/uproot/models/TObjString.py +++ b/src/uproot/models/TObjString.py @@ -3,7 +3,7 @@ """ This module defines a versionless model for ``TObjString``. """ - +from __future__ import annotations import uproot import uproot.serialization diff --git a/src/uproot/models/TObject.py b/src/uproot/models/TObject.py index ff1e9a483..db4cfaf72 100644 --- a/src/uproot/models/TObject.py +++ b/src/uproot/models/TObject.py @@ -3,7 +3,7 @@ """ This module defines a versionless model for ``TObject``. """ - +from __future__ import annotations import json import struct diff --git a/src/uproot/models/TRef.py b/src/uproot/models/TRef.py index 6be8ac98f..0e7bd04c7 100644 --- a/src/uproot/models/TRef.py +++ b/src/uproot/models/TRef.py @@ -3,7 +3,7 @@ """ This module defines versionless models of ``TRef`` and ``TRefArray``. """ - +from __future__ import annotations import json import struct diff --git a/src/uproot/models/TString.py b/src/uproot/models/TString.py index 248fd413d..aa3024f1d 100644 --- a/src/uproot/models/TString.py +++ b/src/uproot/models/TString.py @@ -3,7 +3,7 @@ """ This module defines a versionless model of ``TString``. """ - +from __future__ import annotations import uproot import uproot._awkward_forth diff --git a/src/uproot/models/TTable.py b/src/uproot/models/TTable.py index ba76e5a82..f3723cfec 100644 --- a/src/uproot/models/TTable.py +++ b/src/uproot/models/TTable.py @@ -6,7 +6,7 @@ See :doc:`uproot.behaviors.TBranch` for definitions of ``TTree``-reading functions. """ - +from __future__ import annotations import struct from collections import namedtuple diff --git a/src/uproot/models/TTree.py b/src/uproot/models/TTree.py index 85f93bd93..75e08188b 100644 --- a/src/uproot/models/TTree.py +++ b/src/uproot/models/TTree.py @@ -6,7 +6,7 @@ See :doc:`uproot.behaviors.TBranch` for definitions of ``TTree``-reading functions. """ - +from __future__ import annotations import struct diff --git a/src/uproot/pyroot.py b/src/uproot/pyroot.py index 135e7c15b..f56725b2b 100644 --- a/src/uproot/pyroot.py +++ b/src/uproot/pyroot.py @@ -19,7 +19,7 @@ This module also makes it possible for PyROOT objects to be added to ROOT files that Uproot is writing (regardless of whether Uproot could read such objects). """ - +from __future__ import annotations import threading import uuid diff --git a/src/uproot/reading.py b/src/uproot/reading.py index fabd6344d..63aa88e6f 100644 --- a/src/uproot/reading.py +++ b/src/uproot/reading.py @@ -7,6 +7,7 @@ :doc:`uproot.reading.ReadOnlyDirectory` (``TDirectory`` or ``TDirectoryFile``), and :doc:`uproot.reading.ReadOnlyKey` (``TKey``). """ +from __future__ import annotations import struct import sys diff --git a/src/uproot/serialization.py b/src/uproot/serialization.py index d7a489512..632069168 100644 --- a/src/uproot/serialization.py +++ b/src/uproot/serialization.py @@ -6,7 +6,7 @@ the opposite of :doc:`uproot.deserialization.numbytes_version`, and :doc:`uproot.serialization.serialize_object_any`, the opposite of :doc:`uproot.deserialization.read_object_any`. """ - +from __future__ import annotations import struct diff --git a/src/uproot/streamers.py b/src/uproot/streamers.py index e99bf3ee7..56c522fe5 100644 --- a/src/uproot/streamers.py +++ b/src/uproot/streamers.py @@ -4,6 +4,7 @@ This module defines models for ``TStreamerInfo`` and its elements, as well as routines for generating Python code for new classes from streamer data. """ +from __future__ import annotations import re import struct diff --git a/src/uproot/version.py b/src/uproot/version.py index a3cf39315..a395bccc8 100644 --- a/src/uproot/version.py +++ b/src/uproot/version.py @@ -8,7 +8,7 @@ The version number of Uproot's ``main`` branch in GitHub is usually one ahead of the latest release on PyPI. """ - +from __future__ import annotations import re diff --git a/src/uproot/writing/__init__.py b/src/uproot/writing/__init__.py index f9db1dbf4..f6889dc08 100644 --- a/src/uproot/writing/__init__.py +++ b/src/uproot/writing/__init__.py @@ -9,7 +9,7 @@ interaction: :doc:`uproot.writing.writable.create`, :doc:`uproot.writing.writable.recreate`, and :doc:`uproot.writing.writable.update`. """ - +from __future__ import annotations from uproot.writing.identify import ( to_TArray, diff --git a/src/uproot/writing/_cascade.py b/src/uproot/writing/_cascade.py index c1c5c9f5f..ff04ac9b9 100644 --- a/src/uproot/writing/_cascade.py +++ b/src/uproot/writing/_cascade.py @@ -18,7 +18,7 @@ updates were not organized, redundant overwrites or even infinite cycles could occur. Thus, the structure of the cascade tree must be carefully laid out. """ - +from __future__ import annotations import datetime import math diff --git a/src/uproot/writing/_cascadentuple.py b/src/uproot/writing/_cascadentuple.py index 75b850538..0a912e92c 100644 --- a/src/uproot/writing/_cascadentuple.py +++ b/src/uproot/writing/_cascadentuple.py @@ -8,7 +8,7 @@ See :doc:`uproot.writing._cascade` for a general overview of the cascading writer concept. """ - +from __future__ import annotations import datetime import struct diff --git a/src/uproot/writing/_cascadetree.py b/src/uproot/writing/_cascadetree.py index 1cb84c8ce..edb5462fb 100644 --- a/src/uproot/writing/_cascadetree.py +++ b/src/uproot/writing/_cascadetree.py @@ -13,7 +13,7 @@ See :doc:`uproot.writing._cascade` for a general overview of the cascading writer concept. """ - +from __future__ import annotations import datetime import math diff --git a/src/uproot/writing/identify.py b/src/uproot/writing/identify.py index 43121e21d..1a505b10a 100644 --- a/src/uproot/writing/identify.py +++ b/src/uproot/writing/identify.py @@ -15,6 +15,7 @@ The (many) other functions in this module construct writable :doc:`uproot.model.Model` objects from Python builtins and other writable models. """ +from __future__ import annotations from collections.abc import Mapping