diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml index c579dc1..eff6bf9 100644 --- a/.github/workflows/pip-install.yml +++ b/.github/workflows/pip-install.yml @@ -8,27 +8,28 @@ on: jobs: build: - name: Build wheels on ${{ matrix.os }} + name: 'py${{ matrix.python }} on ${{ matrix.os }}' runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] - python: ['3.7', '3.8', '3.9'] + os: [macos-15-intel, macos-26, ubuntu-22.04, ubuntu-24.04] + python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 name: Install Python with: python-version: ${{ matrix.python }} + allow-prereleases: true - name: Build run: | - python -m pip install -U pip pep517 twine setuptools_scm astropy - python -m pep517.build . + python -m pip install -U pip build twine setuptools setuptools_scm wheel + python -m build - name: Test the sdist run: | @@ -42,21 +43,22 @@ jobs: venv-wheel/bin/python -m pip install dist/vspace*.whl venv-wheel/bin/python -c "import vspace; print(vspace.__version__)" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: dist-${{ matrix.os }}-${{ matrix.python }} path: dist/* upload_pypi: needs: [build] runs-on: ubuntu-latest if: github.event_name == 'release' && github.event.action == 'published' + permissions: + id-token: write steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: artifact + pattern: dist-* path: dist + merge-multiple: true - - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 232761b..b49c356 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,8 +1,6 @@ name: tests on: - push: - branches: [main] pull_request: branches: [main] @@ -13,8 +11,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04] - python-version: ["3.9"] + os: [ubuntu-22.04, ubuntu-24.04, macos-15-intel, macos-latest] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v5 diff --git a/README.md b/README.md index d928f29..890f0c5 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,17 @@
- + - +
- +

diff --git a/tests/FileOps/test_file_operations.py b/tests/FileOps/test_file_operations.py index 8d22032..bfe3ce0 100644 --- a/tests/FileOps/test_file_operations.py +++ b/tests/FileOps/test_file_operations.py @@ -23,7 +23,7 @@ def test_multiple_input_files(): shutil.rmtree(dir) # Run vspace with earth.in and sun.in - subprocess.check_output(["vspace", "vspace_multifile.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_multifile.in"], cwd=path) # Grab the output folders folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -70,7 +70,7 @@ def test_option_addition(): if dir.exists(): shutil.rmtree(dir) - subprocess.check_output(["vspace", "vspace_option_add.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_option_add.in"], cwd=path) folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -106,7 +106,7 @@ def test_option_replacement(): if dir.exists(): shutil.rmtree(dir) - subprocess.check_output(["vspace", "vspace_option_replace.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_option_replace.in"], cwd=path) folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) assert len(folders) == 2, "Should have 2 trials" @@ -163,7 +163,7 @@ def test_source_folder_with_tilde(): shutil.rmtree(dir) # Run vspace - subprocess.check_output(["vspace", "vspace_tilde_test.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_tilde_test.in"], cwd=path) # Verify it worked folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) diff --git a/tests/GridMode/test_multi_parameter.py b/tests/GridMode/test_multi_parameter.py index d0aa072..472b2f8 100644 --- a/tests/GridMode/test_multi_parameter.py +++ b/tests/GridMode/test_multi_parameter.py @@ -24,7 +24,7 @@ def test_two_parameters_cartesian_product(): shutil.rmtree(dir) # Run vspace - subprocess.check_output(["vspace", "vspace_two_param.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_two_param.in"], cwd=path) # Grab the output folders folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -97,7 +97,7 @@ def test_three_parameters_cube(): if dir.exists(): shutil.rmtree(dir) - subprocess.check_output(["vspace", "vspace_three_param.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_three_param.in"], cwd=path) folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -163,7 +163,7 @@ def test_mixed_spacing_types(): if dir.exists(): shutil.rmtree(dir) - subprocess.check_output(["vspace", "vspace_mixed_spacing.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_mixed_spacing.in"], cwd=path) folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) diff --git a/tests/Random/test_cosine.py b/tests/Random/test_cosine.py index 865e6b1..d204588 100644 --- a/tests/Random/test_cosine.py +++ b/tests/Random/test_cosine.py @@ -26,7 +26,7 @@ def test_cosine_degrees(): shutil.rmtree(dir) # Run vspace with fixed seed for reproducibility - subprocess.check_output(["vspace", "vspace_cosine_deg.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_cosine_deg.in"], cwd=path) # Grab the output folders folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -87,7 +87,7 @@ def test_cosine_radians(): if dir.exists(): shutil.rmtree(dir) - subprocess.check_output(["vspace", "vspace_cosine_rad.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_cosine_rad.in"], cwd=path) folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) angles = [] diff --git a/tests/Random/test_gaussian.py b/tests/Random/test_gaussian.py index 18454b9..c9977e0 100644 --- a/tests/Random/test_gaussian.py +++ b/tests/Random/test_gaussian.py @@ -26,7 +26,7 @@ def test_gaussian_basic(): shutil.rmtree(dir) # Run vspace with fixed seed for reproducibility - subprocess.check_output(["vspace", "vspace_gaussian.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_gaussian.in"], cwd=path) # Grab the output folders folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -93,7 +93,7 @@ def test_gaussian_nonstandard(): shutil.rmtree(dir) # Run vspace - subprocess.check_output(["vspace", "vspace_gaussian_nonstandard.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_gaussian_nonstandard.in"], cwd=path) # Extract values folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) diff --git a/tests/Random/test_gaussian_cutoffs.py b/tests/Random/test_gaussian_cutoffs.py index 4330457..17f3455 100644 --- a/tests/Random/test_gaussian_cutoffs.py +++ b/tests/Random/test_gaussian_cutoffs.py @@ -24,7 +24,7 @@ def test_gaussian_min_cutoff(): shutil.rmtree(dir) # Run vspace: Gaussian(0, 1) with min=-1.0 - subprocess.check_output(["vspace", "vspace_gaussian_min.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_gaussian_min.in"], cwd=path, stderr=subprocess.STDOUT) # Extract values folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -72,7 +72,7 @@ def test_gaussian_max_cutoff(): shutil.rmtree(dir) # Run vspace: Gaussian(0, 1) with max=1.0 - subprocess.check_output(["vspace", "vspace_gaussian_max.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_gaussian_max.in"], cwd=path, stderr=subprocess.STDOUT) folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) values = [] @@ -118,7 +118,7 @@ def test_gaussian_both_cutoffs(): shutil.rmtree(dir) # Run vspace: Gaussian(0, 1) with min=-1.5, max=1.5 - subprocess.check_output(["vspace", "vspace_gaussian_both.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_gaussian_both.in"], cwd=path, stderr=subprocess.STDOUT) folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) values = [] diff --git a/tests/Random/test_lognormal.py b/tests/Random/test_lognormal.py index d24d524..5067cb6 100644 --- a/tests/Random/test_lognormal.py +++ b/tests/Random/test_lognormal.py @@ -25,7 +25,7 @@ def test_lognormal_basic(): # Run vspace with fixed seed # Using mean=0, sigma=1 for standard log-normal - subprocess.check_output(["vspace", "vspace_lognormal.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_lognormal.in"], cwd=path) # Grab the output folders folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -91,7 +91,7 @@ def test_lognormal_nonstandard(): if dir.exists(): shutil.rmtree(dir) - subprocess.check_output(["vspace", "vspace_lognormal_nonstandard.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_lognormal_nonstandard.in"], cwd=path) folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) values = [] diff --git a/tests/Random/test_loguniform.py b/tests/Random/test_loguniform.py index e5a6d95..80e00c4 100644 --- a/tests/Random/test_loguniform.py +++ b/tests/Random/test_loguniform.py @@ -27,7 +27,7 @@ def test_loguniform_positive(): shutil.rmtree(dir) # Run vspace with fixed seed for reproducibility - subprocess.check_output(["vspace", "vspace_loguniform.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_loguniform.in"], cwd=path) # Grab the output folders folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -102,7 +102,7 @@ def test_loguniform_negative(): shutil.rmtree(dir) # Run vspace with fixed seed for reproducibility - subprocess.check_output(["vspace", "vspace_loguniform_neg.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_loguniform_neg.in"], cwd=path) # Grab the output folders folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) diff --git a/tests/Random/test_seed_reproducibility.py b/tests/Random/test_seed_reproducibility.py index bf58633..3b676a1 100644 --- a/tests/Random/test_seed_reproducibility.py +++ b/tests/Random/test_seed_reproducibility.py @@ -22,7 +22,7 @@ def test_seed_reproduces_identical_values(): if dir1.exists(): shutil.rmtree(dir1) - subprocess.check_output(["vspace", "vspace_seed_test.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_seed_test.in"], cwd=path) # Extract values from first run folders1 = sorted([f.path for f in os.scandir(dir1) if f.is_dir()]) @@ -39,7 +39,7 @@ def test_seed_reproduces_identical_values(): shutil.rmtree(dir1) # Second run with same seed=12345 - subprocess.check_output(["vspace", "vspace_seed_test.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_seed_test.in"], cwd=path) # Extract values from second run folders2 = sorted([f.path for f in os.scandir(dir1) if f.is_dir()]) @@ -85,7 +85,7 @@ def test_different_seeds_produce_different_values(): if dir1.exists(): shutil.rmtree(dir1) - subprocess.check_output(["vspace", "vspace_seed_test.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_seed_test.in"], cwd=path) folders1 = sorted([f.path for f in os.scandir(dir1) if f.is_dir()]) values1 = [] @@ -103,7 +103,7 @@ def test_different_seeds_produce_different_values(): if dir2.exists(): shutil.rmtree(dir2) - subprocess.check_output(["vspace", "vspace_seed_test2.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_seed_test2.in"], cwd=path) folders2 = sorted([f.path for f in os.scandir(dir2) if f.is_dir()]) values2 = [] diff --git a/tests/Random/test_sine.py b/tests/Random/test_sine.py index 8f8f336..f5c15dc 100644 --- a/tests/Random/test_sine.py +++ b/tests/Random/test_sine.py @@ -26,7 +26,7 @@ def test_sine_degrees(): shutil.rmtree(dir) # Run vspace with fixed seed for reproducibility - subprocess.check_output(["vspace", "vspace_sine_deg.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_sine_deg.in"], cwd=path) # Grab the output folders folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) @@ -89,7 +89,7 @@ def test_sine_radians(): if dir.exists(): shutil.rmtree(dir) - subprocess.check_output(["vspace", "vspace_sine_rad.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_sine_rad.in"], cwd=path) folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) angles = [] diff --git a/tests/Random/test_uniform.py b/tests/Random/test_uniform.py index ef2fd60..3db1bcf 100644 --- a/tests/Random/test_uniform.py +++ b/tests/Random/test_uniform.py @@ -28,7 +28,7 @@ def test_uniform_distribution(): shutil.rmtree(dir) # Run vspace with fixed seed for reproducibility - subprocess.check_output(["vspace", "vspace.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace.in"], cwd=path) # Grab the output folders folders = sorted([f.path for f in os.scandir(dir) if f.is_dir()]) diff --git a/tests/Vspace_Explicit/test_vspace_explicit.py b/tests/Vspace_Explicit/test_vspace_explicit.py index 750debd..54e370a 100644 --- a/tests/Vspace_Explicit/test_vspace_explicit.py +++ b/tests/Vspace_Explicit/test_vspace_explicit.py @@ -17,7 +17,7 @@ def test_vspace_explicit(): shutil.rmtree(dir) # Run vspace - subprocess.check_output(["vspace", "vspace.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace.in"], cwd=path) # Grab the output folders = sorted( diff --git a/tests/Vspace_Linear/test_vspace_linear.py b/tests/Vspace_Linear/test_vspace_linear.py index 816540f..a806a45 100644 --- a/tests/Vspace_Linear/test_vspace_linear.py +++ b/tests/Vspace_Linear/test_vspace_linear.py @@ -17,7 +17,7 @@ def test_vspace_linear(): shutil.rmtree(dir) # Run vspace - subprocess.check_output(["vspace", "vspace.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace.in"], cwd=path) # Grab the output folders = sorted( diff --git a/tests/Vspace_Log/test_vspace_log.py b/tests/Vspace_Log/test_vspace_log.py index 469c890..932a832 100644 --- a/tests/Vspace_Log/test_vspace_log.py +++ b/tests/Vspace_Log/test_vspace_log.py @@ -18,7 +18,7 @@ def test_vspace_log(): shutil.rmtree(dir) # Run vspace - subprocess.check_output(["vspace", "vspace.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace.in"], cwd=path) # Grab the output folders = sorted( diff --git a/tests/Vspace_PreDefPrior_npy/test_vspace_predefprior_npy.py b/tests/Vspace_PreDefPrior_npy/test_vspace_predefprior_npy.py index e3fca7d..e79b7f0 100644 --- a/tests/Vspace_PreDefPrior_npy/test_vspace_predefprior_npy.py +++ b/tests/Vspace_PreDefPrior_npy/test_vspace_predefprior_npy.py @@ -16,7 +16,7 @@ def test_vspace_predefprior_npy(): shutil.rmtree(dir) # Run vspace - subprocess.check_output(["vspace", "vspace_npy.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_npy.in"], cwd=path, stderr=subprocess.STDOUT) # Grab the dat list of randomly selected priors priors = ascii.read(str(dir)+'/rand_list.dat') diff --git a/tests/Vspace_PreDefPrior_txt/test_vspace_predefprior_txt.py b/tests/Vspace_PreDefPrior_txt/test_vspace_predefprior_txt.py index 1f832ce..33af314 100644 --- a/tests/Vspace_PreDefPrior_txt/test_vspace_predefprior_txt.py +++ b/tests/Vspace_PreDefPrior_txt/test_vspace_predefprior_txt.py @@ -16,7 +16,7 @@ def test_vspace_predefprior_txt(): shutil.rmtree(dir) # Run vspace - subprocess.check_output(["vspace", "vspace_txt.in"], cwd=path) + subprocess.check_output(["vspace", "-f", "vspace_txt.in"], cwd=path, stderr=subprocess.STDOUT) # Grab the dat list of randomly selected priors priors = ascii.read(str(dir)+'/rand_list.dat') diff --git a/vspace/vspace.py b/vspace/vspace.py index 761f7c5..9832e06 100644 --- a/vspace/vspace.py +++ b/vspace/vspace.py @@ -399,7 +399,7 @@ def main(): loc=float(values[0]), scale=float(values[1]), size=1, - ) + )[0] del min_cutoff # clean up so next parameter doesn't have spurious min_cutoff elif "min_cutoff" not in vars() and "max_cutoff" in vars(): # user has set a max value for this parameter @@ -410,7 +410,7 @@ def main(): loc=float(values[0]), scale=float(values[1]), size=1, - ) + )[0] del max_cutoff # clean up so next parameter doesn't have spurious max_cutoff elif "min_cutoff" in vars() and "max_cutoff" in vars(): # user has set min and max values for this parameter @@ -424,7 +424,7 @@ def main(): loc=float(values[0]), scale=float(values[1]), size=1, - ) + )[0] del max_cutoff # clean up so next parameter doesn't have spurious cutoffs del min_cutoff # elif "min_cutoff" not in vars() and "max_cutoff" not in vars(): @@ -475,7 +475,7 @@ def main(): mean=float(values[0]), sigma=float(values[1]), size=1, - ) + )[0] del min_cutoff # clean up so next parameter doesn't have spurious min_cutoff elif "min_cutoff" not in vars() and "max_cutoff" in vars(): # user has set a max value for this parameter @@ -486,7 +486,7 @@ def main(): mean=float(values[0]), sigma=float(values[1]), size=1, - ) + )[0] del max_cutoff # clean up so next parameter doesn't have spurious max_cutoff elif "min_cutoff" in vars() and "max_cutoff" in vars(): # user has set min and max values for this parameter @@ -500,7 +500,7 @@ def main(): mean=float(values[0]), sigma=float(values[1]), size=1, - ) + )[0] del max_cutoff # clean up so next parameter doesn't have spurious cutoffs del min_cutoff # elif "min_cutoff" not in vars() and "max_cutoff" not in vars():