Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ 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).

## [Unreleased]
## [0.10.0]

### Added
- Added normal and truncnorm distributions
- COPYRIGHT file for ownership details
- New check for copyright headers in the Makefile

### Changed
- Updated GitHub actions
- Now uses a version of actions/cache that's not deprecated
- Utilizes a shared action for jobs to reduce duplicate code
- Copyright headers in all files
- These now point to the LICENSE and COPYRIGHT files
- LICENSE: Legal permissions (e.g., MIT terms)
- COPYRIGHT: Ownership, institutional metadata
- Make commands that change version/copyright year have been modified

## [0.9.0]

Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Luc Peterson <peterson76@llnl.gov>
Peter Robinson <robsinson96@llnl.gov>
Jessica Semler <semler1@llnl.gov>
Benjamin Bay <bay1@llnl.gov>
Joe Koning <koning1@llnl.gov>
Jeremy White <white242@llnl.gov>
Aidan Keogh
Ryan Lee <lee1098@llnl.gov>
Brian Gunnarson <gunnarson1@llnl.gov>
10 changes: 10 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Copyright (c) 2019–2025 Lawrence Livermore National Laboratory

Produced at the Lawrence Livermore National Laboratory

LLNL-CODE-797170

All rights reserved.

See the CONTRIBUTORS file for a full list of authors and contributors.
See the LICENSE file for license details.
4 changes: 3 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MIT License

Copyright (c) 2022 Lawrence Livermore National Laboratory
See the COPYRIGHT file for ownership and authorship information.

For details, see https://github.com/LLNL/merlin-spellbook.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
42 changes: 31 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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
FROM?=Unreleased

PROJ=spellbook
TEST=tests
Expand All @@ -25,17 +26,22 @@ tests: unit-tests command-line-tests
release:
python3 -m build .

# Use like this: make VER=?.?.? verison
# Increment the Spellbook version. USE ONLY ON DEVELOP BEFORE MERGING TO MASTER.
# Usage: make version VER=1.13.0 FROM=1.13.0-beta
# (defaults to FROM=Unreleased if not set)
version:
# do spellbook/__init__.py
sed -i 's/__version__ = "$(VSTRING)"/__version__ = "$(VER)"/g' $(PROJ)/__init__.py
# do CHANGELOG.md
sed -i 's/## \[Unreleased\]/## [$(VER)]/g' CHANGELOG.md
# do all file headers (works on linux)
find $(PROJ)/ -type f -print0 | xargs -0 sed -i 's/Version: $(VSTRING)/Version: $(VER)/g'
find *.py -type f -print0 | xargs -0 sed -i 's/Version: $(VSTRING)/Version: $(VER)/g'
find $(TEST)/ -type f -print0 | xargs -0 sed -i 's/Version: $(VSTRING)/Version: $(VER)/g'
find Makefile -type f -print0 | xargs -0 sed -i 's/Version: $(VSTRING)/Version: $(VER)/g'
@echo "Updating Spellbook version from [$(FROM)] to [$(VER)]..."
sed -i 's/__version__ = "\(.*\)"/__version__ = "$(VER)"/' spellbook/__init__.py
@if grep -q "## \[$(FROM)\]" CHANGELOG.md; then \
sed -i 's/## \[$(FROM)\]/## [$(VER)]/' CHANGELOG.md; \
else \
echo "⚠️ No matching '## [$(FROM)]' found in CHANGELOG.md"; \
fi

# Increment copyright year = Usage: make year YEAR=2026
year:
@echo "Updating COPYRIGHT file to year $(YEAR)..."
sed -i -E 's/(Copyright \(c\) 2019–)[0-9]{4}( Lawrence Livermore National Laboratory)/\1$(YEAR)\2/' COPYRIGHT

clean:
-find $(PROJ) -name "*.py[cod]" -exec rm -f {} \;
Expand Down Expand Up @@ -79,4 +85,18 @@ check-pylint:
$(PYTHON) -m pylint $(TEST) --rcfile=setup.cfg; \


check-style: check-flake8 check-black check-isort check-pylint
check-copyright:
@echo "🔍 Checking for required copyright header..."
@missing_files=$$(find $(PROJ) $(TEST) \
-name '*.py' -print | \
xargs grep -L "Copyright (c) Lawrence Livermore National Security, LLC and other" || true); \
if [ -n "$$missing_files" ]; then \
echo "❌ The following files are missing the required copyright header:"; \
echo "$$missing_files"; \
exit 1; \
else \
echo "✅ All files contain the required header."; \
fi


check-style: check-copyright check-flake8 check-black check-isort check-pylint
36 changes: 7 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
###############################################################################
# Copyright (c) 2022, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory
# Written by the Merlin dev team, listed in the CONTRIBUTORS file.
# <merlin@llnl.gov>
#
# LLNL-CODE-797170
# All rights reserved.
# This file is part of Merlin-Spellbook, Version: 0.9.0.
#
# For details, see https://github.com/LLNL/merlin-spellbook.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
###############################################################################
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################


import os

Expand Down
9 changes: 8 additions & 1 deletion spellbook/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
__version__ = "0.9.0"
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

__version__ = "0.10.0"

VERSION = __version__
7 changes: 7 additions & 0 deletions spellbook/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

import sys

from spellbook.main import main
Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from abc import ABC, abstractmethod


Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/collect.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from types import SimpleNamespace

import click
Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/conduit-collect.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from types import SimpleNamespace

import click
Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/conduit-translate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

import click


Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/learn.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from types import SimpleNamespace

import click
Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/make-barrier-cost.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from types import SimpleNamespace

import click
Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/make-samples.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

import click


Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/predict.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from types import SimpleNamespace

import click
Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/serialize.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from types import SimpleNamespace

import click
Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/stack-npz.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from types import SimpleNamespace

import click
Expand Down
7 changes: 7 additions & 0 deletions spellbook/commands/translate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from types import SimpleNamespace

import click
Expand Down
6 changes: 6 additions & 0 deletions spellbook/data_formatting/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################
7 changes: 7 additions & 0 deletions spellbook/data_formatting/collector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

import json


Expand Down
6 changes: 6 additions & 0 deletions spellbook/data_formatting/conduit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################
6 changes: 6 additions & 0 deletions spellbook/data_formatting/conduit/python/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################
7 changes: 7 additions & 0 deletions spellbook/data_formatting/conduit/python/collector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################

from __future__ import print_function

from itertools import zip_longest
Expand Down
36 changes: 7 additions & 29 deletions spellbook/data_formatting/conduit/python/conduit_bundler.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
###############################################################################
# Copyright (c) 2022, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory
# Written by the Merlin dev team, listed in the CONTRIBUTORS file.
# <merlin@llnl.gov>
#
# LLNL-CODE-<PENDING>
# All rights reserved.
# This file is part of merlin-spellbook, Version: 0.9.0.
#
# For details, see https://github.com/LLNL/merlin-spellbook.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
###############################################################################
##############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other
# Merlin-Spellbook Project developers. See top-level LICENSE and COPYRIGHT
# files for dates and other details. No copyright assignment is required to
# contribute to Merlin-Spellbook.
##############################################################################


"""
For more info about conduit, see:
Expand Down
Loading