Skip to content

Commit

Permalink
API: rename bad_tools -> hrd_tools
Browse files Browse the repository at this point in the history
And a small amount of joy and mirth left the world
  • Loading branch information
tacaswell committed Feb 10, 2025
1 parent 390f23c commit 7531299
Show file tree
Hide file tree
Showing 29 changed files with 51 additions and 51 deletions.
6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ email: [email protected]
full_name: Thomas A Caswell
license: BSD
org: tacaswell
project_name: bad_tools
project_name: hrd_tools
project_short_description:
Tools for the BAD beamline as part of NEXT-III at NSLS-II.
url: https://github.com/tacaswell/bad_tools
Tools for the HRD beamline as part of NEXT-III at NSLS-II.
url: https://github.com/tacaswell/hrd_tools
vcs: true
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pytest
Use pytest-cov to generate coverage reports:

```bash
pytest --cov=bad_tools
pytest --cov=hrd_tools
```

# Building docs
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bad_tools
# hrd_tools

[![Actions Status][actions-badge]][actions-link]
[![Documentation Status][rtd-badge]][rtd-link]
Expand All @@ -12,16 +12,16 @@
<!-- SPHINX-START -->

<!-- prettier-ignore-start -->
[actions-badge]: https://github.com/tacaswell/bad_tools/workflows/CI/badge.svg
[actions-link]: https://github.com/tacaswell/bad_tools/actions
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/bad_tools
[conda-link]: https://github.com/conda-forge/bad_tools-feedstock
[actions-badge]: https://github.com/tacaswell/hrd_tools/workflows/CI/badge.svg
[actions-link]: https://github.com/tacaswell/hrd_tools/actions
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/hrd_tools
[conda-link]: https://github.com/conda-forge/hrd_tools-feedstock
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
[github-discussions-link]: https://github.com/tacaswell/bad_tools/discussions
[pypi-link]: https://pypi.org/project/bad_tools/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/bad_tools
[pypi-version]: https://img.shields.io/pypi/v/bad_tools
[rtd-badge]: https://readthedocs.org/projects/bad_tools/badge/?version=latest
[rtd-link]: https://bad_tools.readthedocs.io/en/latest/?badge=latest
[github-discussions-link]: https://github.com/tacaswell/hrd_tools/discussions
[pypi-link]: https://pypi.org/project/hrd_tools/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/hrd_tools
[pypi-version]: https://img.shields.io/pypi/v/hrd_tools
[rtd-badge]: https://readthedocs.org/projects/hrd_tools/badge/?version=latest
[rtd-link]: https://hrd_tools.readthedocs.io/en/latest/?badge=latest

<!-- prettier-ignore-end -->
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import importlib.metadata

project = "bad_tools"
project = "hrd_tools"
copyright = "2023, Thomas A Caswell"
author = "Thomas A Caswell"
version = release = importlib.metadata.version("bad_tools")
version = release = importlib.metadata.version("hrd_tools")

extensions = [
"myst_parser",
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bad_tools
# hrd_tools

```{toctree}
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from bluesky import RunEngine
from bluesky.callbacks.best_effort import BestEffortCallback

from bad_tools.sim import make_detector
from hrd_tools.sim import make_detector

bec = BestEffortCallback()

Expand Down
2 changes: 1 addition & 1 deletion examples/location_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import matplotlib.pyplot as plt
import numpy as np

from bad_tools.search import LocRange, Sample, SampleLocation, SampleViz
from hrd_tools.search import LocRange, Sample, SampleLocation, SampleViz

N = 15

Expand Down
2 changes: 1 addition & 1 deletion examples/location_ui2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from bluesky import RunEngine
from bluesky.callbacks.best_effort import BestEffortCallback

from bad_tools.sim import make_sample_rack
from hrd_tools.sim import make_sample_rack

rng = np.random.default_rng(12345)

Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def pylint(session: nox.Session) -> None:
# This needs to be installed into the package environment, and is slower
# than a pre-commit check
session.install(".", "pylint")
session.run("pylint", "bad_tools", *session.posargs)
session.run("pylint", "hrd_tools", *session.posargs)


@nox.session
Expand Down Expand Up @@ -97,7 +97,7 @@ def build_api_docs(session: nox.Session) -> None:
"--module-first",
"--no-toc",
"--force",
"../src/bad_tools",
"../src/hrd_tools",
)


Expand Down
22 changes: 11 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"


[project]
name = "bad_tools"
name = "hrd_tools"
authors = [{ name = "Thomas A Caswell", email = "[email protected]" }]
description = "Tools for the BAD beamline as part of NEXT-III at NSLS-II."
description = "Tools for the HRD beamline as part of NEXT-III at NSLS-II."
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
Expand Down Expand Up @@ -35,14 +35,14 @@ reduction = []
shell = ["xontrib-jedi", "xontrib-vox"]

[project.urls]
Homepage = "https://github.com/tacaswell/bad_tools"
"Bug Tracker" = "https://github.com/tacaswell/bad_tools/issues"
Discussions = "https://github.com/tacaswell/bad_tools/discussions"
Changelog = "https://github.com/tacaswell/bad_tools/releases"
Homepage = "https://github.com/tacaswell/hrd_tools"
"Bug Tracker" = "https://github.com/tacaswell/hrd_tools/issues"
Discussions = "https://github.com/tacaswell/hrd_tools/discussions"
Changelog = "https://github.com/tacaswell/hrd_tools/releases"


[tool.setuptools_scm]
write_to = "src/bad_tools/_version.py"
write_to = "src/hrd_tools/_version.py"


[tool.pytest.ini_options]
Expand All @@ -55,7 +55,7 @@ testpaths = ["tests"]


[tool.coverage]
run.source = ["bad_tools"]
run.source = ["hrd_tools"]
port.exclude_lines = ['pragma: no cover', '\.\.\.', 'if typing.TYPE_CHECKING:']

[tool.mypy]
Expand All @@ -71,7 +71,7 @@ disallow_incomplete_defs = false
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "bad_tools.*"
module = "hrd_tools.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false

Expand All @@ -84,7 +84,7 @@ ignore_missing_imports = true
src = ["src"]
exclude = []
# Uncomment if using a _compat.typing backport
# typing-modules = ["bad_tools._compat.typing"]
# typing-modules = ["hrd_tools._compat.typing"]

[tool.ruff.lint]
select = [
Expand Down Expand Up @@ -147,7 +147,7 @@ channels = ["conda-forge"]
platforms = ["linux-64", "win-64"]

[tool.pixi.pypi-dependencies]
bad_tools = { path = ".", editable = true }
hrd_tools = { path = ".", editable = true }

[tool.pixi.environments]
default = { features = ["reduction"], solve-group = "default" }
Expand Down
4 changes: 2 additions & 2 deletions sims/hello_world/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import xrt.backends.raycing.run as rrun
import xrt.backends.raycing.sources_beams as rsources_beams

from bad_tools.config import AnalyzerConfig, DetectorConfig, SimConfig, SourceConfig
from bad_tools.xrt.endstation import Endstation
from hrd_tools.config import AnalyzerConfig, DetectorConfig, SimConfig, SourceConfig
from hrd_tools.xrt.endstation import Endstation

# copy ESRF geometry as baseline
config_mac = AnalyzerConfig(
Expand Down
4 changes: 2 additions & 2 deletions sims/hello_world/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import tomllib
import tqdm

from bad_tools.config import (
from hrd_tools.config import (
AnalyzerConfig,
DetectorConfig,
SimConfig,
SimScanConfig,
SourceConfig,
)
from bad_tools.xrt.endstation import Endstation
from hrd_tools.xrt.endstation import Endstation


def scan_to_file(
Expand Down
4 changes: 2 additions & 2 deletions sims/ingest_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
from multianalyzer import Result
from scipy.interpolate import splrep, sproot

from bad_tools.config import (
from hrd_tools.config import (
AnalyzerConfig,
CompleteConfig,
)
from bad_tools.sim_reduction import (
from hrd_tools.sim_reduction import (
find_varied_config,
load_all_config,
plot_reduced,
Expand Down
2 changes: 1 addition & 1 deletion sims/run/generate_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import tomli_w
from cycler import Cycler, cycler

from bad_tools.config import (
from hrd_tools.config import (
AnalyzerConfig,
CompleteConfig,
DetectorConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/bad_tools/__init__.py → src/hrd_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Copyright (c) 2023, Brookhaven National Laboratory. All rights reserved.
bad_tools: Tools for the BAD beamline as part of NEXT-III at NSLS-II.
hrd_tools: Tools for the HRD beamline as part of NEXT-III at NSLS-II.
"""

from ._version import version as __version__
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/bad_tools/sim.py → src/hrd_tools/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def inverse(self, value: float) -> float:


class Crystal(Device):
"""A class to simulate a single analyzer crystal on the BAD detectors."""
"""A class to simulate a single analyzer crystal on the HRD detectors."""

offset = _Cpt(Signal, kind="config")
value = _Cpt(CrystalChannel, "angle", kind="hinted", lazy=True, name="")
Expand Down Expand Up @@ -104,7 +104,7 @@ def make_detector(
The function (spectrum) that the detector is simulating.
"""
cls = type(
"BADSimDetector",
"HRDSimDetector",
(DetectorBase,),
{
f"ch{n:02d}": _Cpt(Crystal, offset=offset)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import xrt.backends.raycing.oes as roes
import xrt.backends.raycing.screens as rscreens

from bad_tools.config import AnalyzerConfig, DetectorConfig, SimConfig, SourceConfig
from bad_tools.xrt.sources import XrdSource
from bad_tools.xrt.stops import RectangularBeamstop
from .config import AnalyzerConfig, DetectorConfig, SimConfig, SourceConfig
from .xrt.sources import XrdSource
from .xrt.stops import RectangularBeamstop


@dataclass
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_package.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import importlib.metadata

import bad_tools as m
import hrd_tools as m


def test_version():
assert importlib.metadata.version("bad_tools") == m.__version__
assert importlib.metadata.version("hrd_tools") == m.__version__
2 changes: 1 addition & 1 deletion tiled/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from tiled.type_aliases import JSON
from tiled.utils import node_repr, path_from_uri

from bad_tools.file_io import load_config_from_group
from hrd_tools.file_io import load_config_from_group

SWMR_DEFAULT = bool(int(os.getenv("TILED_HDF5_SWMR_DEFAULT", "0")))
INLINED_DEPTH = int(os.getenv("TILED_HDF5_INLINED_CONTENTS_MAX_DEPTH", "7"))
Expand Down
2 changes: 1 addition & 1 deletion tiled/register_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from tiled.structures.core import StructureFamily
from tiled.structures.data_source import Asset, DataSource, Management

from bad_tools.file_io import find_varied_config
from hrd_tools.file_io import find_varied_config

if __name__ == "__main__":
base_path = pathlib.Path(sys.argv[1])
Expand Down

0 comments on commit 7531299

Please sign in to comment.