Skip to content

Commit

Permalink
Merge branch 'main' into ioanaif/add-TLeafC-support
Browse files Browse the repository at this point in the history
  • Loading branch information
ioanaif authored Sep 19, 2023
2 parents 602270b + 5ae172a commit f04d1a0
Show file tree
Hide file tree
Showing 64 changed files with 734 additions and 682 deletions.
21 changes: 20 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,24 @@
"contributions": [
"code"
]
},
{
"login": "natsukium",
"name": "OTABI Tomoya",
"avatar_url": "https://avatars.githubusercontent.com/u/25083790?v=4",
"profile": "https://github.com/natsukium",
"contributions": [
"test"
]
},
{
"login": "JostMigenda",
"name": "Jost Migenda",
"avatar_url": "https://avatars.githubusercontent.com/u/16189747?v=4",
"profile": "https://github.com/JostMigenda",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
Expand All @@ -496,5 +514,6 @@
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true,
"commitConvention": "angular"
"commitConvention": "angular",
"commitType": "docs"
}
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
shell: "bash -l {0}"

steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"

- name: "Get conda"
uses: "conda-incubator/setup-miniconda@v2"
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:


steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"

- uses: "actions/setup-python@v4"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build wheel and SDist
run: pipx run build
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.3.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.7.0
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.270"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.287"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ The following libraries are also useful in conjunction with Uproot, but are not

**For accessing remote files:**

* `xrootd`: if reading files with `root://` URLs.
* `minio`: if reading files with `s3://` URIs.
* `xrootd`: if reading files with `root://` URIs.
* HTTP/S access is built in (Python standard library).

**For distributed computing with [Dask](https://www.dask.org/):**
Expand Down Expand Up @@ -175,6 +176,8 @@ Thanks especially to the gracious help of Uproot contributors (including the [or
<td align="center" valign="top" width="14.28%"><a href="https://github.com/renyhp"><img src="https://avatars.githubusercontent.com/u/20142663?v=4?s=100" width="100px;" alt="renyhp"/><br /><sub><b>renyhp</b></sub></a><br /><a href="https://github.com/scikit-hep/uproot5/commits?author=renyhp" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lgray"><img src="https://avatars.githubusercontent.com/u/1068089?v=4?s=100" width="100px;" alt="Lindsey Gray"/><br /><sub><b>Lindsey Gray</b></sub></a><br /><a href="https://github.com/scikit-hep/uproot5/commits?author=lgray" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ioanaif"><img src="https://avatars.githubusercontent.com/u/9751871?v=4?s=100" width="100px;" alt="ioanaif"/><br /><sub><b>ioanaif</b></sub></a><br /><a href="https://github.com/scikit-hep/uproot5/commits?author=ioanaif" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/natsukium"><img src="https://avatars.githubusercontent.com/u/25083790?v=4?s=100" width="100px;" alt="OTABI Tomoya"/><br /><sub><b>OTABI Tomoya</b></sub></a><br /><a href="https://github.com/scikit-hep/uproot5/commits?author=natsukium" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/JostMigenda"><img src="https://avatars.githubusercontent.com/u/16189747?v=4?s=100" width="100px;" alt="Jost Migenda"/><br /><sub><b>Jost Migenda</b></sub></a><br /><a href="https://github.com/scikit-hep/uproot5/commits?author=JostMigenda" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion docs-sphinx/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The :doc:`uproot.reading.open` function can be (and usually should be) used like
>>> with uproot.open("path/to/dataset.root") as file:
... do_something...
to automatically close the file after leaving the ``with`` block. The path-name argument can be a local file (as above), a URL ("``http://``" or "``https://``"), or XRootD ("``root://``") if you have the `Python interface to XRootD <https://anaconda.org/conda-forge/xrootd>`__ installed. It can also be a Python file-like object with ``read`` and ``seek`` methods, but such objects can't be read in parallel.
to automatically close the file after leaving the ``with`` block. The path-name argument can be a local file (as above), a URL ("``http://``" or "``https://``"), S3 ("``s3://``) or XRootD ("``root://``") if you have the `Python interface to XRootD <https://anaconda.org/conda-forge/xrootd>`__ installed. It can also be a Python file-like object with ``read`` and ``seek`` methods, but such objects can't be read in parallel.

The :doc:`uproot.reading.open` function has many options, including alternate handlers for each input type, ``num_workers`` to control parallel reading, and caches (``object_cache`` and ``array_cache``). The defaults attempt to optimize parallel processing, caching, and batching of remote requests, but better performance can often be obtained by tuning these parameters.

Expand Down
19 changes: 10 additions & 9 deletions docs-sphinx/make_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import re
import subprocess

from urllib.request import urlopen

tagslist_text = subprocess.run(
["git", "show-ref", "--tags"], stdout=subprocess.PIPE
).stdout
tagslist = {
k: v
for k, v in re.findall(rb"([0-9a-f]{40}) refs/tags/([0-9\.rc]+)", tagslist_text)
for k, v in re.findall(rb"([0-9a-f]{40}) refs/tags/(v?[0-9\.rc]+)", tagslist_text)
if not v.startswith(b"0.")
}

Expand All @@ -21,17 +23,13 @@
).stdout
subjects = re.findall(rb"([0-9a-f]{40}) (.*)", subjects_text)

github_connection = http.client.HTTPSConnection("api.github.com")
github_releases = []
numpages = int(math.ceil(len(tagslist) / 30.0))
for pageid in range(numpages):
print(f"Requesting GitHub data, page {pageid + 1} of {numpages}")
github_connection.request(
"GET",
rf"/repos/scikit-hep/uproot4/releases?page={pageid + 1}&per_page=30",
headers={"User-Agent": "uproot4-changelog"},
)
github_releases_text = github_connection.getresponse().read()
github_releases_text = urlopen(
rf"https://api.github.com/repos/scikit-hep/uproot4/releases?page={pageid + 1}&per_page=30"
).read()
try:
github_releases_page = json.loads(github_releases_text)
except:
Expand Down Expand Up @@ -75,6 +73,9 @@ def pypi_exists(tag):
with open("changelog.rst", "w") as outfile:
outfile.write("Release history\n")
outfile.write("---------------\n")
outfile.write(
"Note: Releases in the 4.3.x series were developed in parallel with v5.0 on a separate branch and are not included here. See the `list of 4.x releases <https://github.com/scikit-hep/uproot5/releases?q=%224.3%22+OR+%22v4.3%22&expanded=true>`__ for details.\n"
)

first = True
numprs = None
Expand Down Expand Up @@ -214,7 +215,7 @@ def pypi_exists(tag):
This was to allow users to transition from Awkward Array 0.x and Uproot 3.x, which had different interfaces (especially Awkward Array). The transition completed on December 1, 2020.
.. image:: https://raw.githubusercontent.com/scikit-hep/uproot4/main/docs-img/diagrams/uproot-awkward-timeline.png
.. image:: https://raw.githubusercontent.com/scikit-hep/uproot5/main/docs-img/diagrams/uproot-awkward-timeline.png
:width: 100%
"""
)
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ dynamic = [
[project.optional-dependencies]
dev = [
"boost_histogram>=0.13",
"dask-awkward>=2022.12a3;python_version >= \"3.8\"",
"dask-awkward>=2023.9.0;python_version >= \"3.8\"",
"dask[array];python_version >= \"3.8\"",
"hist>=1.2",
"pandas",
"awkward-pandas;python_version >= \"3.8\"",
]
test = [
"lz4",
"minio",
"pytest>=6",
"pytest-timeout",
"pytest-rerunfailures",
Expand Down Expand Up @@ -119,16 +120,16 @@ ignore = [
"PLW0120", # else on loop without break
"SIM118", # key in dict, broken since uproot doesn't behave like a dict
"PGH003", # too-broad type ignore
"SIM114", # Combine `if` branches using logical `or` operator
"PGH001", # No eval allowed
"SIM114", # combine `if` branches using logical `or` operator
"PGH001", # no eval allowed
"PLC1901", # empty string is falsey (but I don't want to rely on such weak typing)
"RUF012", # enforces type annotations on a codebase that lacks type annotations
]
exclude = [
"tests/*.py",
"src/uproot/__init__.py",
"docs-sphinx/*.py",
]
target-version = "py37"
src = ["src"]

[tool.ruff.mccabe]
Expand Down
1 change: 1 addition & 0 deletions src/uproot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
from uproot.source.http import MultithreadedHTTPSource
from uproot.source.xrootd import XRootDSource
from uproot.source.xrootd import MultithreadedXRootDSource
from uproot.source.s3 import S3Source
from uproot.source.object import ObjectSource
from uproot.source.cursor import Cursor
from uproot.source.futures import TrivialExecutor
Expand Down
Loading

0 comments on commit f04d1a0

Please sign in to comment.