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
2 changes: 1 addition & 1 deletion .github/workflows/push-pr_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to Merlin Spellbook will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.9.0]

### Added
- Added support for python 3.12 and python 3.13

### Changed
- Dropped support for python 3.7 and older
- Updated Makefile to use newer check-style targets

## [0.8.1]

### Fixed
Expand Down
57 changes: 45 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@

VER?=1.0.0
VSTRING=[0-9]\+\.[0-9]\+\.[0-9]\+
PYTHON?=python3
PY_TARGET_VER?=py311 # At the time this is added (2/19/25) black only supports up to py311

PROJ=spellbook
TEST=tests

# check setup.cfg exists
ifeq (,$(wildcard setup.cfg))
MAX_LINE_LENGTH=127
else
MAX_LINE_LENGTH=$(shell grep 'max-line-length' setup.cfg | cut -d ' ' -f3)
endif

unit-tests:
python3 -m pytest $(TEST)/

Expand Down Expand Up @@ -35,15 +44,39 @@ clean:
-rm -rf build

fix-style:
python3 -m isort --line-length 88 $(PROJ)
python3 -m isort --line-length 88 $(TEST)
python3 -m isort --line-length 88 *.py
python3 -m black --line-length 88 --target-version py36 $(PROJ)
python3 -m black --line-length 88 --target-version py36 $(TEST)
python3 -m black --line-length 88 --target-version py36 *.py

check-style:
python3 -m black --check --line-length 88 --target-version py36 $(PROJ)
python3 -m black --check --line-length 88 --target-version py36 $(TEST)
python3 -m pylint $(PROJ) --rcfile=setup.cfg --exit-zero
python3 -m pylint *.py --rcfile=setup.cfg --exit-zero
python3 -m isort --line-length $(MAX_LINE_LENGTH) $(PROJ)
python3 -m isort --line-length $(MAX_LINE_LENGTH) $(TEST)
python3 -m isort --line-length $(MAX_LINE_LENGTH) *.py
python3 -m black --line-length $(MAX_LINE_LENGTH) --target-version $(PY_TARGET_VER) $(PROJ)
python3 -m black --line-length $(MAX_LINE_LENGTH) --target-version $(PY_TARGET_VER) $(TEST)
python3 -m black --line-length $(MAX_LINE_LENGTH) --target-version $(PY_TARGET_VER) *.py


check-flake8:
echo "Flake8 linting for invalid source (bad syntax, undefined variables)..."; \
$(PYTHON) -m flake8 --count --select=E9,F63,F7,F82 --show-source --statistics; \
echo "Flake8 linting failure for CI..."; \
$(PYTHON) -m flake8 . --count --max-complexity=15 --statistics --max-line-length=127; \


check-black:
$(PYTHON) -m black --check --line-length $(MAX_LINE_LENGTH) --target-version $(PY_TARGET_VER) $(PROJ); \
$(PYTHON) -m black --check --line-length $(MAX_LINE_LENGTH) --target-version $(PY_TARGET_VER) $(TEST); \
$(PYTHON) -m black --check --line-length $(MAX_LINE_LENGTH) --target-version $(PY_TARGET_VER) *.py; \


check-isort:
$(PYTHON) -m isort --check --line-length $(MAX_LINE_LENGTH) $(PROJ); \
$(PYTHON) -m isort --check --line-length $(MAX_LINE_LENGTH) $(TEST); \
$(PYTHON) -m isort --check --line-length $(MAX_LINE_LENGTH) *.py; \


check-pylint:
echo "PyLinting spellbook source..."; \
$(PYTHON) -m pylint $(PROJ) --rcfile=setup.cfg --disable=logging-fstring-interpolation; \
$(PYTHON) -m pylint *.py --rcfile=setup.cfg --exit-zero
echo "PyLinting spellbook tests..."; \
$(PYTHON) -m pylint $(TEST) --rcfile=setup.cfg; \


check-style: check-flake8 check-black check-isort check-pylint
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development dependencies.
pylint
black==22.8.0
black
dep-license
flake8
isort
Expand Down
2 changes: 1 addition & 1 deletion requirements/release.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ importlib_resources; python_version < '3.7'
coloredlogs
click
numpy
pyDOE2
pyDOE3
scipy
scikit-learn
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# LLNL-CODE-797170
# All rights reserved.
# This file is part of Merlin-Spellbook, Version: 0.8.1.
# This file is part of Merlin-Spellbook, Version: 0.9.0.
#
# For details, see https://github.com/LLNL/merlin-spellbook.
#
Expand Down Expand Up @@ -98,11 +98,12 @@ def extras_require():
long_description=readme(),
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
],
keywords="machine learning workflow utilities",
url="https://github.com/LLNL/merlin-spellbook",
Expand Down
2 changes: 1 addition & 1 deletion spellbook/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "0.8.1"
__version__ = "0.9.0"

VERSION = __version__
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# LLNL-CODE-<PENDING>
# All rights reserved.
# This file is part of merlin-spellbook, Version: 0.8.1.
# This file is part of merlin-spellbook, Version: 0.9.0.
#
# For details, see https://github.com/LLNL/merlin-spellbook.
#
Expand Down
6 changes: 3 additions & 3 deletions spellbook/data_formatting/conduit/python/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def run(_input, output, schema):
if data_loader.has_path(sample_path):
data_loader.read(filtered_node[path], sample_path)
else:
filtered_node[
sample_path
] = np.nan # if a value is missing, that could be a problem
filtered_node[sample_path] = (
np.nan
) # if a value is missing, that could be a problem
make_data_array_dict(all_dict, filtered_node)

for dat in all_dict.keys():
Expand Down
2 changes: 1 addition & 1 deletion spellbook/log_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# LLNL-CODE-797170
# All rights reserved.
# This file is part of Merlin Spellbook, Version: 0.8.1.
# This file is part of Merlin Spellbook, Version: 0.9.0.
#
# For details, see https://github.com/LLNL/merlin.
#
Expand Down
2 changes: 1 addition & 1 deletion spellbook/sampling/make_samples.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ast

import numpy as np
import pyDOE2 as doe
import pyDOE3 as doe
from scipy.stats.distributions import norm

from spellbook.commands import CliCommand
Expand Down
2 changes: 1 addition & 1 deletion tests/command_line_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

def run_single_test(name, test, test_label="", buffer_length=50):
dot_length = buffer_length - len(name) - len(str(test_label))
print(f"TEST {test_label}: {name}{'.'*dot_length}", end="")
print(f"TEST {test_label}: {name}{'.' * dot_length}", end="")
command = test[0]
conditions = test[1]
if not isinstance(conditions, list):
Expand Down
Loading