Skip to content

Commit

Permalink
Merge pull request #35 from giganano/main
Browse files Browse the repository at this point in the history
v1.3.1 patch into development branch
  • Loading branch information
giganano committed Feb 8, 2024
2 parents 7f3a048 + 40218cd commit 7437743
Show file tree
Hide file tree
Showing 49 changed files with 923 additions and 503 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-10.15"]
os: ["ubuntu-latest", "macos-latest"]
compiler: [gcc-10, clang]
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"

exclude:

# Mac OS builds run with clang only
- os: "macos-10.15"
- os: "macos-latest"
compiler: gcc-10

# Ubuntu builds run with gcc only
Expand All @@ -41,11 +42,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# compile-time dependency versions reflect those in setup.py
- name: Install Dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install cython>=0.29.21
python -m pip install setuptools>=18.0
python -m pip install Cython>=3.0
- name: Display Environment Variables
shell: bash
Expand All @@ -62,7 +65,7 @@ jobs:
shell: bash
run: |
make CC=$COMPILER
python setup.py build install --quiet
python -m pip install . -v
make clean
- name: Tests
Expand Down
60 changes: 37 additions & 23 deletions .github/workflows/sdist.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,59 @@
# This workflow creates a source distribution intended for uploading to PyPI
# and uploads it to GitHub actions as an artifact, where it then gets
# re-downloaded and combined with other wheels created by the wheels.yml
# workflow.
# This workflow creates a source distribution intended for uploading to PyPI,
# uploading the .tar.gz file to GitHub actions as an artifact. We upload the
# source distribution to PyPI manually. In previous versions of VICE, we
# pre-compiled the code and provided the binaries, but we have scaled this down
# for reasons described in the comments in the wheels.yml workflow file.
# Previously, the wheels.yml workflow would download this source distribution
# and combine it with the wheels created by bdist_linux.yml and bdist_macos.yml.

name: Source Distribution

# only when specifically requested
on:
workflow_call:
inputs:
os:
description: The OS to use for creating the source distribution
required: true
type: string
python-version:
description: The version of python for creating the source distribution
required: true
type: string
workflow_dispatch:
### previous inputs from wheels.yml, which would call this workflow ###
# workflow_call:
# inputs:
# os:
# description: The OS to use for creating the source distribution
# required: true
# type: string
# python-version:
# description: The version of python for creating the source distribution
# required: true
# type: string

jobs:
sdist:
name: Source Distribution
runs-on: ${{ inputs.os }}
env:
COMPILER: gcc
runs-on: ubuntu-latest
### previous inputs from wheels.yml, which would call this workflow ###
# runs-on: ${{ inputs.os }}
# env:
# COMPILER: gcc

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Python ${{ inputs.python-version }}
### previous inputs from wheels.yml, which would call this workflow ###
# - name: Setup Python ${{ inputs.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ inputs.python-version }}

- name: Setup Python 3.12
uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python-version }}
python-version: "3.12"

- name: Install Dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install Cython>=0.29.21
python -m pip install build
python -m pip install setuptools>=18.0
python -m pip install Cython>=3.0
python -m pip install wheel>=0.33.0
- name: Display Environment Variables
Expand All @@ -54,9 +70,7 @@ jobs:
- name: Create Source Distribution
shell: bash
run: |
make
python setup.py sdist
make clean
python -m build --sdist
- name: Upload Source Distribution
uses: actions/upload-artifact@v2
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# This workflow is designed to pre-compile VICE for distribution across all
# versions of python supported by the code base. In the current version,
# however, we simply provide a source distribution will be compiled on each
# user's system. Previous versions had provided pre-compiled binaries, and the
# workflow code which produced those wheels is preserved here. The comments
# from the top of this workflow from this previous distribution strategy are
# copied below. As such, this workflow is generally not invoked; instead we
# dispatch the sdist.yml workflow to create the source distribution.
#
# We elect to provide only a source distribution because, with the limited
# architecture available through GitHub actions for Mac OS, it is likely that
# many end user's of VICE will have to compile in place anyway. This will only
# become more the case in the near future when users will compile it to enable
# multithreading, which will require an in-place compilation.
#
# Previous Notes on Distribution Strategy:
# ----------------------------------------
# This workflow pre-compiles VICE for distribution across all versions of
# python supported by the code base. Requiring a 64-bit system architecture,
# we pre-compile for x86_64 hardware on both Mac OS and Linux. As of yet,
Expand All @@ -9,7 +26,7 @@
#
# At present, GitHub actions does not support a build matrix for jobs that
# call a reusable workflow, so the Mac OS and manylinux jobs here implement
# the workaround from the following URL:
# the workaround from the following URL:
#
# https://github.community/t/reusable-workflow-with-strategy-matrix/205676/8

Expand Down
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@

version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

sphinx:
configuration: docs/src/conf.py

formats:
- pdf

python:
version: 3.8
install:
- requirements: docs/requirements.txt
- method: setuptools
Expand Down
25 changes: 25 additions & 0 deletions changelog.rst.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@

1.3.1
=====
- ``vice.multizone``
Enforces each zone to run in the same mode (related to the handling of
inflow metallicites; see below).

- ``vice.singlezone`` and ``vice.multizone``
- Handles non-zero inflow metallicities in a more stable way. Unit tests
search for numerical artifacts in "sudden event" evolutionary histories
exhibiting bursts in star formation.

- Includes primordial metallicity component in the reported total abundance
in accreting gas at each timestep.

- ``vice.dataframe``
Fixed issues with inheritance structure affecting recent versions of
python (3.11 and 3.12)

- ``vice.yields.ccsne.fractional``
- Subtracts the remnant mass from the initial mass in computing net yields
from the tables containing gross yields. A small correction for metals,
the difference is significant for helium.

- Fixed callback objects to be compatible with Cython>=3.0.

1.3.0
=====
- ``vice.mlr``
Expand Down
4 changes: 3 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

sphinx>=2.0.0
Cython>=0.28.0
Cython>=3.0
setuptools>=18.0

2 changes: 2 additions & 0 deletions docs/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ api:
srcclean:
@ echo Cleaning docs/src/
@ $(MAKE) -C api/ clean
@ rm -f index.rst
@ rm -f cover.tex
@ $(MAKE) clean


63 changes: 60 additions & 3 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,69 @@


# -- Project information -----------------------------------------------------

project = 'VICE'
copyright = '2020-2021, James W. Johnson'
project = "VICE"
copyright = "2020-2023, James W. Johnson"
author = vice.__author__
release = vice.__version__

_PATH_ = os.path.dirname(os.path.abspath(__file__))

with open("%s/cover.tex" % (_PATH_), 'w') as f:
f.write(r"""
%%%%%% VICE documentation PDF cover %%%%%%
%%%%%% generated by: docs/src/conf.py %%%%%%
\begin{center}
\begin{figure}[!h]
\centering
\includegraphics{%s/../../logo/logo.png}
\end{figure}
\underline{\LARGE \textbf{Versatile Integrator for Chemical Evolution}}
\par
{\Large \textbf{Version %s}}
\end{center}
""" % (_PATH_, vice.__version__))

with open("%s/index.rst" % (_PATH_), 'w') as f:
f.write(r"""
.. VICE documentation root file
.. generated by: docs/src/conf.py
VICE: Versatile Integrator for Chemical Evolution
=================================================
Welcome!
This is the documentation for **VICE version %(version)s**.
First time users should familiarize themselves with VICE's API by going
through our `tutorial`__, which can be launched automatically by running
``python -m vice --tutorial`` from a Unix terminal after
:ref:`installing VICE <install>`.
Usage instructions for all of the functions and objects that VICE provides can
be found in our :ref:`comprehensive API reference <apiref>`.
Details on VICE's implementation and justification thereof can be found in
our :ref:`science documentation <scidocs>`.
VICE's developers are happy to consult with scientists looking to
incorporate it into their research.
Email one of our :ref:`contributors <contributors>` or `join us on Slack`__
and start collaborating now!
__ tutorial_
__ slack_
.. _tutorial: https://github.com/giganano/VICE/blob/main/examples/QuickStartTutorial.ipynb
.. _slack: https://join.slack.com/t/vice-astro/shared_invite/zt-tqwa1syp-faiQu0P9oe83cazb0q9tJA
.. toctree::
:maxdepth: 2
install
getting_started
science_documentation/index
api/index
developers/index
""" % {"version": vice.__version__})


# -- General configuration ---------------------------------------------------
extensions = []
Expand Down
10 changes: 0 additions & 10 deletions docs/src/cover.tex

This file was deleted.

Loading

0 comments on commit 7437743

Please sign in to comment.