Skip to content

Commit

Permalink
Merge branch 'master' into single_thread
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Jun 2, 2024
2 parents fbc34d2 + c6d86b3 commit 7dba77c
Show file tree
Hide file tree
Showing 36 changed files with 903 additions and 199 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.6.0
current_version = 1.6.4
files = setup.py strax/__init__.py docs/source/conf.py
commit = True
tag = True
2 changes: 2 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'extra_requirements/requirements-tests.txt'
- name: Install dependencies
run: sudo apt-get install -y graphviz
- name: Install requirements
run: pip install -r extra_requirements/requirements-tests.txt
- name: Start MongoDB
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.4.2
hooks:
- id: black
args: [--safe, --line-length=100, --preview]
Expand All @@ -24,7 +24,7 @@ repos:
- id: docformatter

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.10.0
hooks:
- id: mypy
additional_dependencies: [
Expand Down
59 changes: 59 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
1.6.4 / 2024-05-27
---------------------
* Minor fix on `_is_superrun` variable names by @dachengx in https://github.com/AxFoundation/strax/pull/837
* Implement Hyperrun by @dachengx in https://github.com/AxFoundation/strax/pull/838
* Add function to collect `data_type` and `data_kind` by @dachengx in https://github.com/AxFoundation/strax/pull/839
* Check `include_tags` and `exclude_tags` by @dachengx in https://github.com/AxFoundation/strax/pull/841

**Full Changelog**: https://github.com/AxFoundation/strax/compare/v1.6.3...v1.6.4


1.6.3 / 2024-04-30
---------------------
* Install `graphviz` for the pytests by @dachengx in https://github.com/AxFoundation/strax/pull/817
* Increase the timing precision of progress bar by @dachengx in https://github.com/AxFoundation/strax/pull/819
* Initialize plugin because `depends_on` can be property by @dachengx in https://github.com/AxFoundation/strax/pull/820
* Update context.py by @WenzDaniel in https://github.com/AxFoundation/strax/pull/821
* Disable tqdm progress bar when `check_available` is empty by @dachengx in https://github.com/AxFoundation/strax/pull/822
* Check the consistency of number of items in metadata and data in `dry_load_files` function by @dachengx in https://github.com/AxFoundation/strax/pull/824
* Remove `strax.plugin` by @dachengx in https://github.com/AxFoundation/strax/pull/825
* Pick out selection applying function by @dachengx in https://github.com/AxFoundation/strax/pull/826
* Add `CutList` by @dachengx in https://github.com/AxFoundation/strax/pull/827
* Update tags handling, added comment field. Allows to define superuns … by @WenzDaniel in https://github.com/AxFoundation/strax/pull/798
* Prevent start being negative by @dachengx in https://github.com/AxFoundation/strax/pull/828
* Tiny change on the trailing space by @dachengx in https://github.com/AxFoundation/strax/pull/830
* Add `register_cut_list` by @dachengx in https://github.com/AxFoundation/strax/pull/831
* Record all base classes when multiple inheritance by @dachengx in https://github.com/AxFoundation/strax/pull/832
* Multiple output `DownChunkingPlugin` by @dachengx in https://github.com/AxFoundation/strax/pull/833
* Add `ExhaustPlugin` that exhausts all chunks when fetching data by @dachengx in https://github.com/AxFoundation/strax/pull/835

**Full Changelog**: https://github.com/AxFoundation/strax/compare/v1.6.2...v1.6.3


1.6.2 / 2024-04-04
---------------------
* Use parentheses to separate the class name and attributes in the representation of StorageFrontend by @dachengx in https://github.com/AxFoundation/strax/pull/809
* Specifically install `lxml_html_clean` by @dachengx in https://github.com/AxFoundation/strax/pull/812
* Add a function to purge unused configs by @dachengx in https://github.com/AxFoundation/strax/pull/800
* Warn if user checks is_stored for plugin not always saved by @cfuselli in https://github.com/AxFoundation/strax/pull/796
* Bump urllib3 from 2.2.0 to 2.2.1 in /extra_requirements by @dependabot in https://github.com/AxFoundation/strax/pull/808
* Do not call `get_components` in `is_stored` by @dachengx in https://github.com/AxFoundation/strax/pull/813

New Contributors
* @cfuselli made their first contribution in https://github.com/AxFoundation/strax/pull/796

**Full Changelog**: https://github.com/AxFoundation/strax/compare/v1.6.1...v1.6.2


1.6.1 / 2024-02-17
---------------------
* Remove a redundant function and fix some style by @dachengx in https://github.com/AxFoundation/strax/pull/795
* Find the frontends which stored the targets by @dachengx in https://github.com/AxFoundation/strax/pull/802
* Simpler chunk length check, avoid recursion limit crash by @JelleAalbers in https://github.com/AxFoundation/strax/pull/803
* Deprecate the usage of `XENONnT/ax_env` by @dachengx in https://github.com/AxFoundation/strax/pull/804
* Add a function to directly load file from strax folder by @dachengx in https://github.com/AxFoundation/strax/pull/801


**Full Changelog**: https://github.com/AxFoundation/strax/compare/v1.6.0...v1.6.1


1.6.0 / 2024-01-15
---------------------
* `np.float` is deprecated by @dachengx in https://github.com/AxFoundation/strax/pull/789
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
# built documents.
#
# The short X.Y version.
version = "1.6.0"
version = "1.6.4"
# The full version, including alpha/beta/rc tags.
release = "1.6.0"
release = "1.6.4"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
3 changes: 2 additions & 1 deletion extra_requirements/requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ recommonmark
graphviz
m2r
mistune==0.8.4
urllib3==2.1.0
urllib3==2.2.1
lxml_html_clean
4 changes: 1 addition & 3 deletions extra_requirements/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# File for the requirements of strax with the automated tests
git+https://github.com/XENONnT/ax_env
deepdiff
ipython==8.12.1
git+https://github.com/XENONnT/base_environment
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def open_requirements(path):

setuptools.setup(
name="strax",
version="1.6.0",
version="1.6.4",
description="Streaming analysis for xenon TPCs",
author="strax developers",
url="https://github.com/AxFoundation/strax",
Expand Down
2 changes: 1 addition & 1 deletion strax/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# flake8: noqa
__version__ = "1.6.0"
__version__ = "1.6.4"

# Glue the package together
# See https://www.youtube.com/watch?v=0oTh1CXRaQ0 if this confuses you
Expand Down
33 changes: 5 additions & 28 deletions strax/chunk.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import typing as ty
from functools import wraps

import numpy as np
import numba
Expand Down Expand Up @@ -72,6 +71,8 @@ def __init__(
raise ValueError(
f"Attempt to create chunk {self} with data of {dtype}, should be {expected_dtype}"
)
if self.start < 0:
raise ValueError(f"Attempt to create chunk {self} with negative start time")
if self.start > self.end:
raise ValueError(f"Attempt to create chunk {self} with negative length")

Expand Down Expand Up @@ -107,8 +108,7 @@ def __repr__(self):
return (
f"[{self.run_id}.{self.data_type}: "
f"{self._t_fmt(self.start)} - {self._t_fmt(self.end)}, "
f"{len(self)} items, "
+ "{0:.1f} MB/s]".format(self._mbs())
f"{len(self)} items, " + "{0:.1f} MB/s]".format(self._mbs())
)

@property
Expand Down Expand Up @@ -245,7 +245,7 @@ def merge(cls, chunks, data_type="<UNKNOWN>"):
)

@classmethod
def concatenate(cls, chunks):
def concatenate(cls, chunks, allow_hyperrun=False):
"""Create chunk by concatenating chunks of same data type You can pass None's, they will be
ignored."""
chunks = [c for c in chunks if c is not None]
Expand All @@ -261,7 +261,7 @@ def concatenate(cls, chunks):

run_ids = [c.run_id for c in chunks]

if len(set(run_ids)) != 1:
if len(set(run_ids)) != 1 and not allow_hyperrun:
raise ValueError(
f"Cannot concatenate {data_type} chunks with different run ids: {run_ids}"
)
Expand Down Expand Up @@ -422,29 +422,6 @@ def _update_subruns_in_chunk(chunks):
return subruns


@export
def check_chunk_n(f):
@wraps(f)
def wrapper(self, *args, **kwargs):
# assume chunk_info is the second argument
if "chunk_info" not in kwargs:
raise ValueError(
"chunk_info not passed to function, check_chunk_n ",
"can only be used with functions that take chunk_info as an argument, ",
"usually it is the strax.StorageBackend._read_chunk method.",
)
chunk_info = kwargs["chunk_info"]
chunk = f(self, *args, **kwargs)
if len(chunk) != chunk_info["n"]:
raise strax.DataCorrupted(
f"Chunk {chunk_info['filename']} of {chunk_info['run_id']} has {len(chunk)} items, "
f"but chunk_info {chunk_info} says {chunk_info['n']}"
)
return chunk

return wrapper


@export
class Rechunker:
"""Helper class for rechunking.
Expand Down
12 changes: 7 additions & 5 deletions strax/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ def __init__(
# DeprecationWarning)

if (
sum([
self.default is not OMITTED,
self.default_factory is not OMITTED,
self.default_by_run is not OMITTED,
])
sum(
[
self.default is not OMITTED,
self.default_factory is not OMITTED,
self.default_by_run is not OMITTED,
]
)
> 1
):
raise RuntimeError(f"Tried to specify more than one default for option {self.name}.")
Expand Down
Loading

0 comments on commit 7dba77c

Please sign in to comment.