Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/titan' into get_atom_data_error
Browse files Browse the repository at this point in the history
  • Loading branch information
odstrcilt committed Jul 20, 2024
2 parents d308905 + 6d1eade commit 394a11f
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 159 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install setuptools wheel numpy
- name: Build the package
run: python setup.py sdist
#- name: Build the package
# run: python setup.py sdist
- name: Publish distribution 📦 to Test PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
build_command: ["python setup.py develop",
"pip install .",
"pip install --editable .",
"python setup.py install",
# "echo 'no operation'", # how to test this one?
build_command: [
"pip install .",
"pip install --editable .",
]
fail-fast: false

Expand All @@ -25,15 +23,15 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
- name: Install Aurora
run: ${{ matrix.build_command }}
- name: Move to root and try importing Aurora
run: |
cd /
python -c "import aurora; print(aurora.__version__)"
- name: Run test_basic.py
run: |
python examples/test_basic.py
# - name: Test with pytest and coverage
# run: |
# pip install pytest
Expand Down
43 changes: 43 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 3.17.2...3.26)
project(${SKBUILD_PROJECT_NAME} LANGUAGES C Fortran)

find_package(
Python
COMPONENTS Interpreter Development.Module NumPy
REQUIRED)

# F2PY headers
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
"import numpy.f2py; print(numpy.f2py.get_include())"
OUTPUT_VARIABLE F2PY_INCLUDE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)

add_library(fortranobject OBJECT "${F2PY_INCLUDE_DIR}/fortranobject.c")
target_link_libraries(fortranobject PUBLIC Python::NumPy)
target_include_directories(fortranobject PUBLIC "${F2PY_INCLUDE_DIR}")
set_property(TARGET fortranobject PROPERTY POSITION_INDEPENDENT_CODE ON)

add_custom_command(
OUTPUT _auroramodule.c example-f2pywrappers.f
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/aurora/main.f90"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/impden.f90"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/math.f90"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/grids.f90"
VERBATIM
COMMAND "${Python_EXECUTABLE}" -m numpy.f2py
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/main.f90"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/impden.f90"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/math.f90"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/grids.f90"
-m _aurora --lower)

python_add_library(_aurora MODULE "${CMAKE_CURRENT_BINARY_DIR}/_auroramodule.c"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/main.f90"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/impden.f90"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/math.f90"
"${CMAKE_CURRENT_SOURCE_DIR}/aurora/grids.f90"
WITH_SOABI)
target_link_libraries(_aurora PRIVATE fortranobject)

install(TARGETS _aurora DESTINATION aurora/)
5 changes: 5 additions & 0 deletions aurora/adas_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ def adas_files_dict():
files["Ca"]["brs"] = "brs05360.dat"
files["Ca"]["pbs"] = ""
files["Ca"]["prc"] = ""
files["Ti"] = {} # 22
files["Ti"]["acd"] = "acd00_ti.dat"
files["Ti"]["scd"] = "scd00_ti.dat"
files["Ti"]['prb'] = "prb00_ti.dat"
files["Ti"]['plt'] = "plt00_ti.dat"
files["Fe"] = {} # 26
files["Fe"]["acd"] = "acd89_fe.dat"
files["Fe"]["scd"] = "scd89_fe.dat"
Expand Down
43 changes: 0 additions & 43 deletions makefile

This file was deleted.

53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[project]
name = "aurorafusion"
dynamic = ["version"]
description = "Aurora package for particle transport, radiation and neutrals in magnetically-confined plasmas"
authors = [
{ name = "F. Sciortino", email = "[email protected]" },
]
urls = { "Homepage" = "https://github.com/fsciortino/Aurora" }
keywords = ["particle and impurity transport, neutrals, radiation, magnetic confinement fusion"]
classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [
"matplotlib",
"numpy<2.0.0",
"omfit_classes",
"pandas",
"pexpect",
"requests",
"scipy",
# transitive dependencies of omfit_classes
# that omfit_classes does not advertise
"fortranformat",
"netCDF4",
"uncertainties",
"omas",
# omfit_classes will have issues with newer versions
# of xarray for two different reasons:
# 1. because of a recently-introduced xarray bug that
# will be fixed in the next release after v2024.02.0
# (this commit: https://github.com/pydata/xarray/commit/a241845c0dfcb8a5a0396f5ef7602e9dae6155c0).
# This constrains xarray<=v2023.07.0.
# 2. because omfit_classes uses xarray.plot.plot, which has
# been removed/renamed by a commit from October 2022.
# This constrains xarray<=v2022.09.0
"xarray==v2022.09.0",
# omfit_classes has issues with newer versions of
# matplotlib, see https://github.com/gafusion/OMFIT-source/issues/6784
"matplotlib<=3.5",
]

[build-system]
requires = ["scikit-build-core", "numpy"]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
ninja.minimum-version = "1.10"
cmake.minimum-version = "3.17.2"
wheel.packages = ["aurora"]

[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "aurora/__init__.py"
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

97 changes: 0 additions & 97 deletions setup.py

This file was deleted.

0 comments on commit 394a11f

Please sign in to comment.