Skip to content

Commit

Permalink
The great name change: uproot4 -> uproot. (#211)
Browse files Browse the repository at this point in the history
* The great name change: uproot4 -> uproot.

* Black and Flake8.

* Added builder for uproot4 thin package (untested) and bump Awkward version requirement.

* Try again.

* Actually ask for awkward>=1.0.0rc1 in the workflow.

* Add uproot.interpretation.identify.
  • Loading branch information
jpivarski authored Dec 1, 2020
1 parent 9e959c2 commit b44d7db
Show file tree
Hide file tree
Showing 119 changed files with 3,532 additions and 3,659 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Note that we'll be closing the issue as soon as a solution is proposed. This is

Please attach a small ROOT file that reproduces the issue! If small and public, you can drag-and-drop it into the issue. If large, you can put it on some large-file service (e.g. Dropbox). In general, we can't access XRootD URLs (most are not public).

Include the version number (and update if necessary, if you're not using the [latest version](https://pypi.org/project/uproot4/)).
Include the version number (and update if necessary, if you're not using the [latest version](https://pypi.org/project/uproot/)).

```python
>>> import uproot4
>>> uproot4.__version__
>>> import uproot
>>> uproot.__version__
```
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

On the [tutorials site](https://uproot4.readthedocs.io/)?
On the [tutorials site](https://uproot.readthedocs.io/)?

In the Python docstrings? (They're presented on the same website.)

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ What you're looking for might already be possible as a combination of existing f

Here are some links to documentation, to help you in your search.

* [The tutorials site](https://uproot4.readthedocs.io/)
* [The tutorials site](https://uproot.readthedocs.io/)
* [StackOverflow: [uproot] tag](https://stackoverflow.com/questions/tagged/uproot)
* [Gitter: Scikit-HEP/uproot room](https://gitter.im/Scikit-HEP/uproot)
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: "Install Awkward"
run: |
conda env list
pip install awkward1
pip install "awkward>=1.0.0rc1"
conda list
- name: "Install XRootD"
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Sphinx documentation
docs-sphinx/_build
docs-sphinx/uproot4.rst
docs-sphinx/uproot4.*.rst
docs-sphinx/uproot.rst
docs-sphinx/uproot.*.rst
docs-sphinx/*.toctree

# Byte-compiled / optimized / DLL files
Expand Down
70 changes: 70 additions & 0 deletions build-uproot4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/master/LICENSE

set -e

rm -rf build dist
mkdir build
mkdir build/uproot4

cat > build/uproot4/__init__.py << EOF
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/master/LICENSE
from __future__ import absolute_import
from uproot import *
EOF

cat > build/uproot4-setup.py << EOF
import setuptools
from setuptools import setup
def get_version():
g = {}
exec(open(os.path.join("uproot", "version.py")).read(), g)
return g["__version__"]
setup(name = "uproot4",
packages = ["uproot4"],
package_dir = {"": "build"},
version = get_version(),
author = "Jim Pivarski",
author_email = "[email protected]",
maintainer = "Jim Pivarski",
maintainer_email = "[email protected]",
description = "ROOT I/O in pure Python and NumPy.",
long_description = open("README.md").read(),
long_description_content_type = "text/markdown",
url = "https://github.com/scikit-hep/uproot4",
download_url = "https://github.com/scikit-hep/uproot4/releases",
license = "BSD 3-clause",
python_requires = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
install_requires = ["uproot>=4.0.0rc1"],
classifiers = [
# "Development Status :: 1 - Planning",
# "Development Status :: 2 - Pre-Alpha",
# "Development Status :: 3 - Alpha",
# "Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
# "Development Status :: 6 - Mature",
# "Development Status :: 7 - Inactive",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development",
"Topic :: Utilities",
])
EOF
130 changes: 65 additions & 65 deletions docs-sphinx/basic.rst

Large diffs are not rendered by default.

38 changes: 18 additions & 20 deletions docs-sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,41 @@
basic
uproot3-to-4

.. include:: uproot4.toctree
.. include:: uproot.toctree

.. include:: uproot4.reading.toctree
.. include:: uproot.reading.toctree

.. include:: uproot4.behaviors.toctree
.. include:: uproot.behaviors.toctree

.. include:: uproot4.model.toctree
.. include:: uproot.model.toctree

.. include:: uproot4.streamers.toctree
.. include:: uproot.streamers.toctree

.. include:: uproot4.cache.toctree
.. include:: uproot.cache.toctree

.. include:: uproot4.compression.toctree
.. include:: uproot.compression.toctree

.. include:: uproot4.deserialization.toctree
.. include:: uproot.deserialization.toctree

.. include:: uproot4.source.toctree
.. include:: uproot.source.toctree

.. include:: uproot4.interpretation.toctree
.. include:: uproot.interpretation.toctree

.. include:: uproot4.containers.toctree
.. include:: uproot.containers.toctree

.. include:: uproot4.language.toctree
.. include:: uproot.language.toctree

.. include:: uproot4.models.toctree
.. include:: uproot.models.toctree

.. include:: uproot4.const.toctree
.. include:: uproot.const.toctree

.. include:: uproot4.extras.toctree
.. include:: uproot.exceptions.toctree

.. include:: uproot4.version.toctree
.. include:: uproot.extras.toctree

.. toctree::
:hidden:

uproot4.dynamic

.. |br| raw:: html

<br/>
Expand All @@ -59,13 +57,13 @@ Usually, you'll want to install Uproot with `Awkward Array <https://awkward-arra

.. code-block:: bash
pip install uproot4 awkward1
pip install uproot awkward
But if you are working in a limited environment, Uproot can be installed without Awkward Array.

.. code-block:: bash
pip install uproot4
pip install uproot
Just be sure to pass ``library="np"`` to any function that returns arrays to specify that you want NumPy arrays, rather than Awkward arrays. Other array libraries include `Pandas <https://pandas.pydata.org/>`__ and `CuPy <https://cupy.dev/>`__, which, like Awkward, would need to be explicitly installed.

Expand Down
2 changes: 1 addition & 1 deletion docs-sphinx/make_changelog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# # BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE
# # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/master/LICENSE

# import math
# import json
Expand Down
58 changes: 29 additions & 29 deletions docs-sphinx/prepare_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@


order = [
"uproot4",
"uproot4.reading",
"uproot4.behaviors",
"uproot4.model",
"uproot4.streamers",
"uproot4.cache",
"uproot4.compression",
"uproot4.deserialization",
"uproot4.source",
"uproot4.interpretation",
"uproot4.containers",
"uproot4.language",
"uproot4.models",
"uproot4.const",
"uproot4.extras",
"uproot4.version",
"uproot",
"uproot.reading",
"uproot.behaviors",
"uproot.model",
"uproot.streamers",
"uproot.cache",
"uproot.compression",
"uproot.deserialization",
"uproot.source",
"uproot.interpretation",
"uproot.containers",
"uproot.language",
"uproot.models",
"uproot.const",
"uproot.exceptions",
"uproot.extras",
]

toctree = open("uproot4.toctree", "w")
toctree = open("uproot.toctree", "w")
toctree.write(
""".. toctree::
:caption: Reference
Expand Down Expand Up @@ -58,7 +58,7 @@ def handle_module(modulename, module):
ensure(modulename, modulename + ".rst", content)
toctree.write(" " + modulename + "\n")

if modulename != "uproot4" and all(
if modulename != "uproot" and all(
not x.startswith("_") for x in modulename.split(".")
):

Expand Down Expand Up @@ -90,14 +90,14 @@ def line_order(obj):
methods = {}
mro = list(cls.__mro__)

import uproot4
if hasattr(uproot4, cls.__name__):
title = "uproot4." + cls.__name__
import uproot
if hasattr(uproot, cls.__name__):
title = "uproot." + cls.__name__
else:
title = classname

for index, basecls in enumerate(mro):
if basecls.__module__.startswith("uproot4."):
if basecls.__module__.startswith("uproot."):

def good(obj):
if inspect.ismethod(obj) or inspect.isfunction(obj):
Expand All @@ -106,7 +106,7 @@ def good(obj):
module, name = obj.fget.__module__, obj.fget.__name__
else:
module, name = "", ""
if module.startswith("uproot4."):
if module.startswith("uproot."):
if index + 1 >= len(mro) or obj is not getattr(
mro[index + 1], name, None
):
Expand Down Expand Up @@ -135,7 +135,7 @@ def good(obj):

def prettymro(c):
fullname = c.__module__ + "." + c.__name__
if c.__module__.startswith("uproot4."):
if c.__module__.startswith("uproot."):
return "#. :doc:`" + fullname + "`"
else:
return "#. ``" + fullname + "``"
Expand All @@ -161,9 +161,9 @@ def prettymro(c):


def handle_function(functionname, cls):
import uproot4
if hasattr(uproot4, cls.__name__):
title = "uproot4." + cls.__name__
import uproot
if hasattr(uproot, cls.__name__):
title = "uproot." + cls.__name__
else:
title = functionname

Expand All @@ -179,7 +179,7 @@ def handle_function(functionname, cls):
for modulename in order:
module = importlib.import_module(modulename)

if modulename != "uproot4":
if modulename != "uproot":
toctree = open(modulename + ".toctree", "w")
toctree.write(
""".. toctree::
Expand All @@ -189,7 +189,7 @@ def handle_function(functionname, cls):
)

handle_module(modulename, module)
if module.__file__.endswith("__init__.py") and modulename != "uproot4":
if module.__file__.endswith("__init__.py") and modulename != "uproot":
for submodulename in sorted(
[
modulename + "." + name
Expand Down
2 changes: 1 addition & 1 deletion docs-sphinx/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sphinx>=2.4.4
uproot4
uproot
Loading

0 comments on commit b44d7db

Please sign in to comment.