Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ lib64

# Sphinx
docs/_build
docs/source/developer/contributing.rst
docs/source/reference/release_notes.rst
docs/source/reference/release_notes.md

# Pycharm
.idea
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build:
apt_packages:
- graphviz
tools:
python: "3.10"
python: "3.12"

python:
install:
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## Contribution guidelines
# Contribution guidelines

You're welcome to contribute to strax!

Currently, many features are still in significant flux, and the documentation is still very basic. Until more people start getting involved in development, we're probably not even following our own advice below...

### Please fork
## Please fork
Please work in a fork, then submit pull requests.
Only maintainers sometimes work in branches if there is a good reason for it.

### No large files
## No large files
Avoid committing large (> 100 kB) files. We'd like to keep the repository no more than a few MB.

For example, do not commit jupyter notebooks with high-resolution plots (clear the output first), or long configuration files, or binary test data.
Expand All @@ -17,7 +17,7 @@ While it's possible to rewrite history to remove large files, this is a bit of w

This is one reason to prefer forks over branches; if you commit a huge file by mistake it's just in your fork.

### Code style
## Code style
Of course, please write nice and clean code :-)

PEP8-compatibility is great (you can test with flake8) but not as important as other good coding habits such as avoiding duplication. See e.g. the [famous beyond PEP8 talk](https://www.youtube.com/watch?v=wf-BqAjZb8M).
Expand All @@ -26,5 +26,5 @@ In particular, don't go into code someone else is maintaining to "PEP8-ify" it (

Other style guidelines (docstrings etc.) are yet to be determined.

### Pull requests
## Pull requests
When accepting pull requests, preferrably squash as it attributes all the commits to one single pull request. One might consider merging the pull request without squashing if it's a few commits that mostly outline discrete steps of an implementation which seem worth keeping.
1 change: 1 addition & 0 deletions docs/source/advanced/fuzzy_for.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ How to use
----------
There are two ways of ignoring the lineage. Both are set in the context config
(see context.context_config):

- ``fuzzy_for_options`` a tuple of options to specify that each option with a
name in the tuple can be ignored
- ``fuzzy_for`` a tuple of data-types to ignore.
Expand Down
9 changes: 6 additions & 3 deletions docs/source/advanced/plugin_dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ _________________________


strax.LoopPlugin
__________
----------------

.. code-block:: python

class LoopData(strax.LoopPlugin):
Expand All @@ -144,7 +145,8 @@ __________


strax.CutPlugin
_________________________
---------------

.. code-block:: python

class CutData(strax.CutPlugin):
Expand All @@ -164,7 +166,8 @@ _________________________


strax.MergeOnlyPlugin
________
---------------------

.. code-block:: python

class MergeData(strax.MergeOnlyPlugin):
Expand Down
6 changes: 4 additions & 2 deletions docs/source/advanced/recompression.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ from the fact that `bz2` compresses the data much more than the default
compressor `blosc`.

How does this work?
__________________
___________________

Strax knows from the metadata stored with the data with witch
compressor the data was written. It is possible to use a different
compressor when re-writing the data to disk (as done for `strax` knows
Expand Down Expand Up @@ -171,7 +172,8 @@ will output:
dest_mb 0.349218

Using script to profile write/read rates for compressors
--------------------------------------------------------
________________________________________________________

This script can easily be used to profile different compressors:

.. code-block:: bash
Expand Down
1 change: 1 addition & 0 deletions docs/source/basics/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Let's have a look what this looks like for our current context:


.. code-block:: python

>>> peak_processing = context.get_single_plugin(run_id='some_run', data_name='peaks')
>>> peak_processing.lineage
{'peaks': ('PeakProcessing', '0.0.0', {'peak_type': 1}),
Expand Down
42 changes: 12 additions & 30 deletions docs/source/build_release_notes.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,24 @@
from m2r import convert
import os
import re

header = """
Release notes
==============

"""
header = "# Release notes\n\n"


def convert_release_notes():
"""Convert the release notes to an RST page with links to PRs."""
"""Write the release notes as Markdown with links to PRs."""
this_dir = os.path.dirname(os.path.realpath(__file__))
notes = os.path.join(this_dir, "..", "..", "HISTORY.md")
with open(notes, "r") as f:
with open(notes, "r", encoding="utf-8") as f:
notes = f.read()
rst = convert(notes)
with_ref = ""
for line in rst.split("\n"):
# Get URL for PR
if "#" in line:
pr_number = line.split("#")[1]
while len(pr_number):
try:
pr_number = int(pr_number)
break
except ValueError:
# Too many tailing characters to be an int
pr_number = pr_number[:-1]
if pr_number:
line = line.replace(
f"#{pr_number}",
f"`#{pr_number} <https://github.com/AxFoundation/strax/pull/{pr_number}>`_",
)
with_ref += line + "\n"
target = os.path.join(this_dir, "reference", "release_notes.rst")

with open(target, "w") as f:
f.write(header + with_ref)
def link_pull_request(match):
number = match.group(1)
return f"[#{number}](https://github.com/AxFoundation/strax/pull/{number})"

notes = re.sub(r"(?<![\w/\[])#(\d+)", link_pull_request, notes)
target = os.path.join(this_dir, "reference", "release_notes.md")
with open(target, "w", encoding="utf-8") as f:
f.write(header + notes)


if __name__ == "__main__":
Expand Down
25 changes: 2 additions & 23 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"nbsphinx",
"myst_parser",
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -45,10 +45,6 @@
# You can specify multiple suffix as a list of string:
source_suffix = [".rst", ".md"]

source_parsers = {
".md": "recommonmark.parser.CommonMarkParser",
}


# The encoding of source files.
# source_encoding = 'utf-8-sig'
Expand All @@ -75,7 +71,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -299,22 +295,6 @@
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}


def write_contributing():
"""Convert contributing to rst."""
from m2r import convert
import os

this_dir = os.path.dirname(os.path.realpath(__file__))
source = os.path.join(this_dir, "developer", "contributing.md")
with open(source, "r") as f:
source = f.read()
rst = convert(source)
target = os.path.join(this_dir, "developer", "contributing.rst")

with open(target, "w") as f:
f.write(rst)


def setup(app):
# Hack to import something from this dir. Apparently we're in a weird
# situation where you get a __name__ is not in globals KeyError
Expand All @@ -326,4 +306,3 @@ def setup(app):
import build_release_notes

build_release_notes.convert_release_notes()
write_contributing()
14 changes: 0 additions & 14 deletions docs/source/developer/corrections.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/reference/strax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ strax.context module
:undoc-members:
:show-inheritance:

strax.corrections module
------------------------

.. automodule:: strax.corrections
:members:
:undoc-members:
:show-inheritance:

strax.dtypes module
-------------------

Expand Down
83 changes: 34 additions & 49 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tool]
[tool.poetry]
[project]
name = "strax"
version = "2.2.3"
description = "Streaming analysis for xenon TPCs"
readme = "README.md"
requires-python = ">=3.11,<3.13"
authors = [
"strax developers",
{ name = "strax developers" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -17,59 +17,44 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Physics",
]
repository = "https://github.com/AxFoundation/strax"
dependencies = [
"blosc",
"click",
"deepdiff",
"dill",
"fsspec",
"immutabledict",
"lz4",
"numba>=0.43.1",
"numexpr",
"numpy>=1.18.5",
"numcodecs<0.16.0",
"packaging",
"pandas",
"pymongo",
"pytz",
"scipy",
"tqdm>=4.46.0",
"zarr<3.0.0",
"zstd",
"zstandard",
]

[tool.poetry.scripts]
rechunker = "strax.scripts.rechunker:main"
[project.urls]
Repository = "https://github.com/AxFoundation/strax"

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
blosc = "*"
click = "*"
deepdiff = "*"
dill = "*"
fsspec = "*"
immutabledict = "*"
lz4 = "*"
numba = ">=0.43.1"
numexpr = "*"
numpy = ">=1.18.5"
numcodecs = "<0.16.0"
packaging = "*"
pandas = "*"
psutil = "*"
pymongo = "*"
pytz = "*"
scipy = "*"
tqdm = ">=4.46.0"
zarr = "<3.0.0"
zstd = "*"
zstandard = "*"
sphinx = { version = "*", optional = true }
sphinx_rtd_theme = { version = "*", optional = true }
nbsphinx = { version = "*", optional = true }
recommonmark = { version = "*", optional = true }
graphviz = { version = "*", optional = true }
m2r = { version = "*", optional = true }
mistune = { version = "0.8.4", optional = true }
urllib3 = { version = "2.3.0", optional = true }
lxml_html_clean = { version = "*", optional = true }
[project.scripts]
rechunker = "strax.scripts.rechunker:main"

[tool.poetry.extras]
[project.optional-dependencies]
docs = [
"sphinx",
"sphinx_rtd_theme",
"nbsphinx",
"recommonmark",
"graphviz",
"m2r",
"mistune",
"urllib3",
"lxml_html_clean",
"myst-parser>=4,<6",
"sphinx>=7,<9",
"sphinx-rtd-theme>=3,<4",
]

[build-system]
requires = ["poetry-core>=1.0.8", "setuptools>=61.0"]
requires = ["poetry-core>=2.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
Expand Down
Loading