Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure as a Python package #98

Merged
merged 70 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
c39cf44
put dependencies in pyproject.toml
wtbarnes Aug 23, 2024
8947033
move examples under docs dir
wtbarnes Aug 23, 2024
347df4a
restructure as python package
wtbarnes Aug 23, 2024
cc4bd9c
clean up gitignore
wtbarnes Aug 23, 2024
8878c8e
no more printing to files
wtbarnes Aug 23, 2024
fde4f6b
move plotting script
wtbarnes Aug 23, 2024
4ccfcac
move util script to main package
wtbarnes Aug 23, 2024
e122b75
return namedtuple with units
wtbarnes Aug 23, 2024
6e522c5
update tests
wtbarnes Aug 23, 2024
4f62c0d
move radiation data under package
wtbarnes Aug 23, 2024
436ea02
pass in path to radiation data directory
wtbarnes Aug 23, 2024
a01e354
move all cpp files to extern dir
wtbarnes Aug 23, 2024
7c38b8a
inputs now read directly from dictionary
wtbarnes Aug 24, 2024
f743790
better naming conventions
wtbarnes Aug 25, 2024
2713846
add models for configuring run
wtbarnes Aug 25, 2024
5c06211
reorganize to separate high and low level functions
wtbarnes Aug 25, 2024
3b0aa49
avoid using python structs internally to C++ as this causes seg-fault
wtbarnes Aug 25, 2024
3c71246
update tests to use model classes
wtbarnes Aug 25, 2024
881a921
dem options no longer passed as nested dict
wtbarnes Aug 25, 2024
e74b168
remove src layout
wtbarnes Aug 26, 2024
6fb4539
move to OA package template
wtbarnes Aug 26, 2024
6d8f5fb
minor fixes for template
wtbarnes Aug 26, 2024
0a40e84
start organizing docs
wtbarnes Aug 26, 2024
72ec89e
get minimal doc build working
wtbarnes Aug 26, 2024
7dfa3e2
start converting old md docs to sphinx
wtbarnes Aug 26, 2024
a4e6cb1
translate parameter descriptions to docstrings
wtbarnes Aug 27, 2024
28bdb73
turn old example code into example gallery
wtbarnes Aug 27, 2024
fbe216f
make default max timestep 10 s
wtbarnes Aug 27, 2024
747735f
RTD config
wtbarnes Aug 27, 2024
d55be34
fix versioning
wtbarnes Aug 27, 2024
784b6e6
install boost on rtd
wtbarnes Aug 27, 2024
f909720
install boost on rtd
wtbarnes Aug 27, 2024
093c17b
more theme cleanup
wtbarnes Aug 27, 2024
f817169
add separate page on software comparison
wtbarnes Aug 27, 2024
4e60e9b
skip windows test for now
wtbarnes Aug 27, 2024
040a99f
add gallery build to tox
wtbarnes Aug 27, 2024
1cf531a
update readme
wtbarnes Aug 28, 2024
69c9c9a
small readme tweaks
wtbarnes Aug 28, 2024
8c663a9
apply precommit
wtbarnes Aug 28, 2024
f81b4d6
add docstring for build_configuration
wtbarnes Aug 28, 2024
74ea6bf
try to get cmake to find boost on windows
wtbarnes Aug 28, 2024
71b4785
try earlier msvc boost on chocolatey
wtbarnes Aug 28, 2024
6104ade
add codecov badge
wtbarnes Aug 28, 2024
de6c38a
try casting fs::path to string to make Windows happy
wtbarnes Aug 28, 2024
32cc3c8
only run windows tests for debugging
wtbarnes Aug 28, 2024
bd8d7f1
add all jobs back; run publish on all platforms
wtbarnes Aug 28, 2024
967a90a
add all jobs back; run publish on all platforms
wtbarnes Aug 28, 2024
30748d4
test publish workflow
wtbarnes Aug 28, 2024
c7bc5dc
use yum instead of apt
wtbarnes Aug 28, 2024
283b9e0
only build 64bit wheels on windows
wtbarnes Aug 28, 2024
cdfe7fb
try to get yum install to work
wtbarnes Aug 29, 2024
6a83786
all test data in txt format to remove h5py dependency
wtbarnes Aug 29, 2024
a159166
add flag for forcing C++17 on macOS
wtbarnes Aug 29, 2024
d3b04ac
more permissive windows builds; still trying to convince macos to use…
wtbarnes Aug 29, 2024
8f3fa2c
fix skip flag?
wtbarnes Aug 29, 2024
bf3f03a
build arm and amd windows
wtbarnes Aug 29, 2024
8b6badd
matching osx targets
wtbarnes Aug 29, 2024
2eb57c1
osx 10.15; no windows arm
wtbarnes Aug 29, 2024
ba11b3b
unskip the rest of the CI
wtbarnes Aug 29, 2024
d7729b1
add note about time-varying abundances
wtbarnes Sep 5, 2024
8e783f5
Update .readthedocs.yml
wtbarnes Sep 5, 2024
6bee69f
Update .readthedocs.yml
wtbarnes Sep 5, 2024
0655f4e
Update docs/conf.py
wtbarnes Sep 5, 2024
4075fb8
Update docs/conf.py
wtbarnes Sep 5, 2024
3741d74
Update docs/conf.py
wtbarnes Sep 5, 2024
4fbbae1
Update pyproject.toml
wtbarnes Sep 5, 2024
7fcb78a
Update pyproject.toml
wtbarnes Sep 5, 2024
31d032c
Update pyproject.toml
wtbarnes Sep 5, 2024
0855cbe
more suggestions from code review
wtbarnes Sep 5, 2024
6f87448
switch column ordering in comparison table
wtbarnes Sep 5, 2024
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
31 changes: 31 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"template": "https://github.com/OpenAstronomy/packaging-guide",
"commit": "ad6da17e1d8fd96456566abed30b510bf8b5f8c8",
"checkout": null,
"context": {
"cookiecutter": {
"package_name": "ebtelplusplus",
"module_name": "ebtelplusplus",
"short_description": "Zero-dimensional hydrodynamics of coronal loops",
"author_name": "Will Barnes",
"author_email": "[email protected]",
"project_url": "https://github.com/rice-solar-physics/ebtelplusplus",
"license": "GNU GPL v3+",
"minimum_python_version": "3.10",
"use_compiled_extensions": "y",
"enable_dynamic_dev_versions": "y",
"include_example_code": "n",
"include_cruft_update_github_workflow": "y",
"_sphinx_theme": "alabaster",
"_parent_project": "",
"_install_requires": "",
"_copy_without_render": [
"docs/_templates",
"docs/_static",
".github/workflows/sub_package_update.yml"
],
"_template": "https://github.com/OpenAstronomy/packaging-guide"
}
},
"directory": null
}
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI

on:
push:
branches:
- 'main'
- '*.*'
tags:
- 'v*'
pull_request:
workflow_dispatch:

jobs:
core:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
toxdeps: tox-pypi-filter
envs: |
- linux: py312
libraries:
apt:
- libboost-all-dev
coverage: 'codecov'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

tests:
needs: [core]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
toxdeps: tox-pypi-filter
envs: |
- windows: py310
libraries:
choco:
- boost-msvc-14.2
- macos: py311
libraries:
brew:
- boost
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

docs:
needs: [tests]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
toxdeps: tox-pypi-filter
envs: |
- linux: build_docs-gallery
python-version: '3.12'
libraries:
apt:
- libboost-all-dev


publish:
# Build wheels when pushing to any branch except main
# publish.yml will only publish if tagged ^v.*
if: |
(
github.event_name != 'pull_request' && (
github.ref_name != 'main' ||
github.event_name == 'workflow_dispatch'
)
) || (
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Run publish')
)
needs: [tests]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@main
with:
test_extras: 'test'
test_command: 'pytest -p no:warnings --doctest-rst --pyargs ebtelplusplus'
sdist: false
env: |
CIBW_BEFORE_BUILD_LINUX: yum install -y boost-devel
CIBW_BEFORE_BUILD_MACOS: brew install boost
CIBW_BEFORE_BUILD_WINDOWS: choco install -y boost-msvc-14.2
MACOSX_DEPLOYMENT_TARGET: 10.15
targets: |
- cp3{10,11,12}-macosx_arm64
- cp3{10,11,12}-macosx_x86_64
- cp3{10,11,12}-manylinux_aarch64
- cp3{10,11,12}-manylinux_x86_64
- cp3{10,11,12}-win_amd64
secrets:
pypi_token: ${{ secrets.PYPI_TOKEN }}
38 changes: 0 additions & 38 deletions .github/workflows/deploy-docs.yml

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/sub_package_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# This template is taken from the cruft example code, for further information please see:
# https://cruft.github.io/cruft/#automating-updates-with-github-actions
name: Automatic Update from package template
permissions:
contents: write
pull-requests: write

on:
# Allow manual runs through the web UI
workflow_dispatch:
schedule:
# ┌───────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 7 * * 1' # Every Monday at 7am UTC

jobs:
update:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- add-paths: .
body: apply the changes to this repo.
branch: cruft/update
commit-message: "Automatic package template update"
title: Updates from the package template
- add-paths: .cruft.json
body: reject these changes for this repo.
branch: cruft/reject
commit-message: "Reject this package template update"
title: Reject new updates from package template

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Cruft
run: python -m pip install git+https://github.com/Cadair/cruft@patch-p1

- name: Check if update is available
continue-on-error: false
id: check
run: |
CHANGES=0
if [ -f .cruft.json ]; then
if ! cruft check; then
CHANGES=1
fi
else
echo "No .cruft.json file"
fi

echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT"

- name: Run update if available
if: steps.check.outputs.has_changes == '1'
run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"

cruft update --skip-apply-ask --refresh-private-variables
git restore --staged .

- name: Create pull request
if: steps.check.outputs.has_changes == '1'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: ${{ matrix.add-paths }}
commit-message: ${{ matrix.commit-message }}
branch: ${{ matrix.branch }}
delete-branch: true
branch-suffix: timestamp
title: ${{ matrix.title }}
body: |
This is an autogenerated PR, which will ${{ matrix.body }}.
[Cruft](https://cruft.github.io/cruft/) has detected updates from the Package Template
39 changes: 0 additions & 39 deletions .github/workflows/tests.yml

This file was deleted.

Loading