Skip to content

Commit 12c5e94

Browse files
committed
Merge branch 'master' into norm_for_each_many_vars
2 parents aff96bf + a41f42b commit 12c5e94

File tree

8 files changed

+30
-9
lines changed

8 files changed

+30
-9
lines changed

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ubuntu-latest, windows-latest]
15-
python-version: [3.11, 3.12, 3.13]
15+
python-version: [3.11, 3.12, 3.13, 3.14]
1616

1717
steps:
1818
- uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 25.1.0 # Replace by any tag/version: https://github.com/psf/black/tags
2+
- repo: https://github.com/psf/black-pre-commit-mirror
3+
rev: 25.9.0 # Replace by any tag/version: https://github.com/psf/black/tags
44
hooks:
55
- id: black
66
language_version: python3 # Should be a command that runs python3.6+

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
55

66
## [Unreleased]
77

8+
## [3.6.1]
9+
10+
### Changed
11+
- local version identifier uses only ASCII letters/numbers and periods (PEP 440)
12+
- actively supporting python 3.11-3.14
13+
- `Data.create_constant`: allow kwargs to be passed to the constant creation
14+
815
## [3.6.0]
916

1017
### Added
@@ -430,8 +437,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
430437
### Added
431438
- initial release
432439

433-
[Unreleased]: https://github.com/wright-group/WrightTools/-/compare/3.6.0...master
434-
[3.6.0]: https://github.com/wright-group/WrightTools/-/compare/3.5.5...3.6.0
440+
[Unreleased]: https://github.com/wright-group/WrightTools/-/compare/3.6.1...master
441+
[3.6.1]: https://github.com/wright-group/WrightTools/compare/3.6.0...3.6.1
442+
[3.6.0]: https://github.com/wright-group/WrightTools/compare/3.5.5...3.6.0
435443
[3.5.5]: https://github.com/wright-group/WrightTools/compare/3.5.3...3.5.5
436444
[3.5.4]: https://github.com/wright-group/WrightTools/compare/3.5.3...3.5.4
437445
[3.5.3]: https://github.com/wright-group/WrightTools/compare/3.5.2...3.5.3

WrightTools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.6.0
1+
3.6.1

WrightTools/__version__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
if p.exists():
3333
with open(str(p)) as f:
3434
__branch__ = f.readline().rstrip().split(r"/")[-1]
35-
__version__ += "+" + __branch__
35+
# clean local verson (PEP 440)
36+
__version__ += (
37+
f"+{''.join(char if (char.isalnum() or char=='.') else '.' for char in __branch__)}"
38+
)
3639
else:
3740
__branch__ = None

WrightTools/data/_data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,7 @@ def set_constants(self, *constants, verbose=True):
22662266
self.flush()
22672267
self._on_constants_updated()
22682268

2269-
def create_constant(self, expression, *, verbose=True):
2269+
def create_constant(self, expression, verbose=True, **kwargs):
22702270
"""Append a constant to the stored list.
22712271
22722272
Parameters
@@ -2275,6 +2275,8 @@ def create_constant(self, expression, *, verbose=True):
22752275
Expression for the new constant.
22762276
verbose : boolean (optional)
22772277
Toggle talkback. Default is True
2278+
**kwargs
2279+
extra kwargs are passed to `Constant.__init__`
22782280
22792281
See Also
22802282
--------
@@ -2286,7 +2288,7 @@ def create_constant(self, expression, *, verbose=True):
22862288
if expression in self.constant_expressions:
22872289
wt_exceptions.ObjectExistsWarning.warn(expression)
22882290
return self.constants[self.constant_expressions.index(expression)]
2289-
constant = Constant(self, expression)
2291+
constant = Constant(self, expression, **kwargs)
22902292
if constant.units is None:
22912293
constant.convert(constant.variables[0].units)
22922294
self._constants.append(constant)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ classifiers = [
3131
"Programming Language :: Python :: 3.11",
3232
"Programming Language :: Python :: 3.12",
3333
"Programming Language :: Python :: 3.13",
34+
"Programming Language :: Python :: 3.14",
3435
"Topic :: Scientific/Engineering",
3536
]
3637
keywords = ["spectroscopy", "science", "multidimensional", "visualization"]

tests/data/constants.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ def test_set_remove():
1818
assert data.constant_names == ()
1919

2020

21+
def test_units():
22+
"""smokescreen to make sure units can be specified for constant creation"""
23+
data = wt.Data()
24+
data.create_variable("y", np.ones((3,)), units="ps")
25+
data.create_constant("y", units="wn")
26+
27+
2128
def test_label():
2229
data = wt.Data()
2330
data.create_variable("x", np.linspace(0, 10))

0 commit comments

Comments
 (0)