Skip to content
Merged
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
44 changes: 13 additions & 31 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
environment
===========

First, download this code::
First, download/clone the repository::

git clone https://github.com/larpix/ndlar_flow
git clone https://github.com/DUNE/ndlar_flow

venv method (recommended)
-------------------------
Expand All @@ -21,46 +21,28 @@ Create and activate a virtual environment::
python -m venv ndlar_flow.venv
source ndlar_flow.venv/bin/activate

Install the ``h5flow`` framework::

git clone https://github.com/larpix/h5flow
cd h5flow
pip install -e .
cd ..

Finally, install ``ndlar_flow``::
Install ``ndlar_flow``::

cd ndlar_flow
pip install -e .

Note that the ``-e`` option installs the packages in "editable" mode, meaning
any changes you make will take effect without the need to re-run ``pip install``.

The next section describes the older setup procedure based on ``conda``. The
comments regarding MPI are historical; h5flow's MPI support is slated to be
removed in the future.

conda method (deprecated)
-------------------------

To install proper dependencies, use the provided conda environment file ``env.yaml``::

conda env create -f env.yaml -n <environment name>
conda activate <environment>

To update an existing environment::
legacy install notes
--------------------

conda env update -f env.yaml -n <environment name>
Previous versions of ndlar-flow assumed h5flow was already installed or available
in the current environment.

If MPI is not available, you may use the alternative environment file
(``env-nompi.yaml``) that does not install parallel-HDF5. The ``ndlar_flow`` code
is built off of ``h5flow`` [https://github.com/larpix/h5flow], so you
will also need to install this in order to run any of the workflows described
here.
To install h5flow manually::

To install::
git clone https://github.com/DUNE/h5flow
cd h5flow
pip install -e .
cd ..

pip install .
Be sure this is in the same (virtual) environment as ndlar-flow.

usage
=====
Expand Down
14 changes: 0 additions & 14 deletions env-nompi.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions env.yaml

This file was deleted.

67 changes: 67 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[build-system]
requires = ["setuptools>=64.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "ndlar_flow"
description = "An h5flow-based analysis framework for DUNE ND-LAr simulation and data"
readme = { file = "README.rst", content-type = "text/x-rst" }
authors = [
{ name = "Peter Madigan" }
]
maintainers = [
{ name = "Yifan Chen" },
{ name = "Matt Kramer" },
{ name = "Noe Roy" },
{ name = "Kevin Wood" },
]
requires-python = ">=3.7"
license = "Apache-2.0"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Physics"
]
dynamic = ["version"]
dependencies = [
"h5py>=2.10",
"pytest",
"scipy",
"scikit-image",
"scikit-learn>=1.3.0",
"dbscan1d==0.2.3",
"h5flow @ git+https://github.com/DUNE/h5flow.git#egg=h5flow",
"pylandau @ git+https://github.com/SiLab-Bonn/pylandau.git",
"adc64format @ git+https://github.com/larpix/adc64format.git@v0.1.5#egg=adc64format",
]

[tool.setuptools.dynamic]
version = { file = "VERSION" }

[tool.setuptools.packages.find]
where = ["src"]

[tool.ruff]
line-length = 100
indent-width = 4

[tool.ruff.format]
quote-style = "single"
indent-style = "space"
line-ending = "auto"

[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # Pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"I", # isort
]
ignore = ["E501"]

[tool.mypy]
disable_error_code = ["import-untyped"]
29 changes: 0 additions & 29 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion test/env-nompi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ dependencies:
- pip:
- pyyaml-include==1.3.2
- adc64format>=0.0.2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here: If at some point we add tests that use newer light files, the old PyPI release of adc64format will cause problems. The github release listed in pyproject.toml will work, of course. Would be nice if we could avoid this duplication of dependency specifications...

Anyway, beyond the scope of this PR. Just thinking out loud.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think we can just get rid of all the dependencies here, given that the test workflow does a pip install . and will pick everything up from the pyproject.toml.

- git+https://github.com/cuddandr/pylandau.git@npy_owndata_fix
- git+https://github.com/SiLab-Bonn/pylandau.git
2 changes: 1 addition & 1 deletion test/env.yaml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we've given up on using MPI in practice, we can probably get rid of this file and replace it with env-nompi.yaml (renamed to env.yaml?)

Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ dependencies:
- pyyaml-include==1.3.2
- h5py --no-binary=h5py
- adc64format>=0.0.2
- git+https://github.com/cuddandr/pylandau.git@npy_owndata_fix
- git+https://github.com/SiLab-Bonn/pylandau.git
Loading