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

chore: Update to fgen=0.4.1 #2

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
57 changes: 28 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,34 @@ jobs:
- name: docs
run: poetry run sphinx-build -W --keep-going -T -b html docs/source docs/build

# Fix the tests in the next MR
# tests:
# strategy:
# fail-fast: false
# matrix:
# os: [ "ubuntu-latest" ]
# python-version: [ "3.10", "3.11", "3.12" ]
# runs-on: "${{ matrix.os }}"
# defaults:
# run:
# # This might be needed for Windows and doesn't seem to affect unix-based systems
# # so we include it. If you have better proof of whether this is needed or not,
# # feel free to update.
# shell: bash
# steps:
# - name: Check out repository
# uses: actions/checkout@v3
# - uses: ./.github/actions/setup
# with:
# os: "${{ matrix.os }}"
# python-version: "${{ matrix.python-version }}"
# venv-id: "tests-${{ runner.os }}"
# poetry-dependency-install-flags: "--all-extras"
# - name: Run tests
# run: |
# poetry run pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml
# poetry run coverage report
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
tests:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.10", "3.11", "3.12" ]
runs-on: "${{ matrix.os }}"
defaults:
run:
# This might be needed for Windows and doesn't seem to affect unix-based systems
# so we include it. If you have better proof of whether this is needed or not,
# feel free to update.
shell: bash
steps:
- name: Check out repository
uses: actions/checkout@v3
- uses: ./.github/actions/setup
with:
os: "${{ matrix.os }}"
python-version: "${{ matrix.python-version }}"
venv-id: "tests-${{ runner.os }}"
poetry-dependency-install-flags: "--all-extras"
- name: Run tests
run: |
poetry run pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml
poetry run coverage report
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

imports-without-extras:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion cmake/Findfgen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The following cache variables may be set to influence the library detection:
set(_lib "fgen")
set(_pkg "FGEN")
set(_url "https://gitlab.com/magicc/fgen")
set(_hash "7068f0ec5cd028977c6952434d909e40a729d91e") # v0.3.1
set(_hash "5a0f96071addcae99a272cecb845770b533ae582") # v0.4.1

if(NOT DEFINED "${_pkg}_FIND_METHOD")
if(DEFINED "${PROJECT_NAME}-dependency-method")
Expand Down
145 changes: 11 additions & 134 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ packages = [{include = "fgen_example", from = "src"}]
python = "^3.9"
pint = "^0.22"
numpy = "^1.25.2"
fgen = "0.3.1"
fgen = "0.4.1"

[tool.poetry.group.tests.dependencies]
pytest = "^7.3.1"
Expand All @@ -49,7 +49,7 @@ liccheck = "^0.9.1"
cmakelang = "^0.6.13"

[build-system]
requires = ["scikit-build-core", "oldest-supported-numpy", "fgen==0.3.1"]
requires = ["scikit-build-core", "oldest-supported-numpy", "fgen[templates]==0.4.1"]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@znicholls this is a nice part about splitting out the template dependencies. fgen[templates] is only needed as a build dep

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

build-backend = "scikit_build_core.build"

[tool.scikit-build]
Expand Down Expand Up @@ -135,6 +135,7 @@ ignore = [
"D105", # Missing docstring in magic method
"D200", # One-line docstring should fit on one line with quotes
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood
]
# Provide some leeway for long docstring, this is otherwise handled by black
line-length = 110
Expand Down
26 changes: 16 additions & 10 deletions src/fgen_example/_lib/derived_type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,33 @@ provides:
description: An example of a derived type
attributes:
base:
description: Base value
definition:
description: Base value
fortran_type: real(8)
unit: m
fortran_type: real(8)
methods:
add:
description: Add another value to `self.base`
parameters:
other:
description: Quantity to add
definition:
description: Quantity to add
fortran_type: real(8)
unit: m
fortran_type: real(8)

returns:
name: output
description: Sum of `self.base` and `other`
definition:
name: output
description: Sum of `self.base` and `other`
fortran_type: real(8)
unit: m
fortran_type: real(8)

double:
description: Double `self.base`
parameters: {}
returns:
name: output
description: Double `self.base`
definition:
name: output
description: Double `self.base`
fortran_type: real(8)
unit: m
fortran_type: real(8)
Loading
Loading