Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Documentation

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[docs]

- name: Build documentation
run: |
cd doc
make html

- name: Deploy documentation to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/_build/html
force_orphan: true
99 changes: 99 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.12", "3.13"]
numpy-version: [""]
include:
# Test Python 3.11 with both numpy 1.x and 2.x
- os: ubuntu-latest
python-version: "3.11"
numpy-version: "<2.0"
- os: ubuntu-latest
python-version: "3.11"
numpy-version: ">=2.0"
- os: windows-latest
python-version: "3.11"
numpy-version: "<2.0"
- os: windows-latest
python-version: "3.11"
numpy-version: ">=2.0"
- os: macos-latest
python-version: "3.11"
numpy-version: "<2.0"
- os: macos-latest
python-version: "3.11"
numpy-version: ">=2.0"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for setuptools-scm versioning

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]

- name: Install specific numpy version
if: matrix.numpy-version != ''
run: |
pip install "numpy${{ matrix.numpy-version }}"

- name: Run tests
run: |
pytest pyexodus/tests

test-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
pip install pytest-cov

- name: Run tests with coverage
run: |
pytest pyexodus/tests --cov=pyexodus --cov-report=xml --cov-report=term-missing

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
*.egg-info
.cache
pyexodus/RELEASE-VERSION
pyexodus/_version.py
doc/_build/
dist/
build/
__pycache__/
*.pyc
23 changes: 0 additions & 23 deletions .travis-update-gh-pages.sh

This file was deleted.

37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 pyexodus developers
Copyright (c) 2016-2026 pyexodus developers

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

18 changes: 10 additions & 8 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
# ones.
import pyexodus

import klink

html_theme = "klink"
html_theme_path = [klink.get_html_theme_path()]
html_theme_options = {"github": "SalvusHub/pyexodus", "logo": "logo.svg"}
html_theme = "furo"
html_theme_options = {
"source_repository": "https://github.com/SalvusHub/pyexodus",
"source_branch": "main",
"source_directory": "doc/",
}
html_logo = "_static/logo.svg"

extensions = [
"sphinx.ext.autodoc",
Expand All @@ -62,7 +64,7 @@

# General information about the project.
project = "pyexodus"
copyright = "2016, Lion Krischer"
copyright = "2026 Mondaic Ltd."
author = "Lion Krischer"

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -79,7 +81,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -357,4 +359,4 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/": None}
intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}
8 changes: 4 additions & 4 deletions pyexodus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# -*- coding: utf-8 -*-
"""
:copyright:
Lion Krischer (lionkrischer@gmail.com), 2016
Lion Krischer (lion.krischer@mondaic.com), 2016-2026
Mondaic Ltd. (info@mondaic.com), 2020-2026
:license:
MIT License
"""
from __future__ import absolute_import
from importlib.metadata import version as _get_version

from .core import exodus # NOQA
from .version import get_git_version

__version__ = get_git_version()
__version__ = _get_version("pyexodus")
3 changes: 2 additions & 1 deletion pyexodus/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# -*- coding: utf-8 -*-
"""
:copyright:
Lion Krischer (lionkrischer@gmail.com), 2022
Lion Krischer (lion.krischer@mondaic.com), 2022-2026
Mondaic Ltd. (info@mondaic.com), 2022-2026
:license:
MIT License
"""
Expand Down
11 changes: 6 additions & 5 deletions pyexodus/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# -*- coding: utf-8 -*-
"""
:copyright:
Lion Krischer (lionkrischer@gmail.com), 2022
Lion Krischer (lion.krischer@mondaic.com), 2022-2026
Mondaic Ltd. (info@mondaic.com), 2022-2026
:license:
MIT License
"""
Expand Down Expand Up @@ -270,7 +271,7 @@ def put_elem_blk_info(
dtype=np.int32,
**self._comp_opts
)
self._f.variables[var_name].attrs["elem_type"] = np.string_(elemType)
self._f.variables[var_name].attrs["elem_type"] = np.bytes_(elemType)

# Set the status and thus "claim" the element block id.
self._f.variables["eb_status"][idx - 1] = 1
Expand Down Expand Up @@ -934,7 +935,7 @@ def _write_attrs(self, title):
self._f.attrs["file_size"] = np.array([1], dtype=np.int32)
self._f.attrs["maximum_name_length"] = np.array([32], dtype=np.int32)
self._f.attrs["int64_status"] = np.array([0], dtype=np.int32)
self._f.attrs["title"] = np.string_(title)
self._f.attrs["title"] = np.bytes_(title)

def _create_variables(self):
# Time steps.
Expand Down Expand Up @@ -963,7 +964,7 @@ def _create_variables(self):
data=[-1] * get_dim_size(self._f, "num_el_blk"),
**self._comp_opts
)
self._f.variables["eb_prop1"].attrs["name"] = np.string_("ID")
self._f.variables["eb_prop1"].attrs["name"] = np.bytes_("ID")

# Coordinate names.
self._f.create_variable(
Expand Down Expand Up @@ -997,7 +998,7 @@ def _create_variables(self):
data=[-1] * get_dim_size(self._f, "num_side_sets"),
**self._comp_opts
)
self._f.variables["ss_prop1"].attrs["name"] = np.string_("ID")
self._f.variables["ss_prop1"].attrs["name"] = np.bytes_("ID")
self._f.create_variable(
"/ss_status",
("num_side_sets",),
Expand Down
2 changes: 1 addition & 1 deletion pyexodus/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
:copyright:
Lion Krischer (lionkrischer@gmail.com), 2016
Lion Krischer (lion.krischer@mondaic.com), 2016-2026
:license:
MIT License
"""
3 changes: 2 additions & 1 deletion pyexodus/tests/test_reading_exodus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# -*- coding: utf-8 -*-
"""
:copyright:
Lion Krischer (lionkrischer@gmail.com), 2017
Lion Krischer (lion.krischer@mondaic.com), 2017-2026
Mondaic Ltd. (info@mondaic.com), 2020-2026
:license:
MIT License
"""
Expand Down
3 changes: 2 additions & 1 deletion pyexodus/tests/test_writing_exodus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# -*- coding: utf-8 -*-
"""
:copyright:
Lion Krischer (lionkrischer@gmail.com), 2016
Lion Krischer (lion.krischer@mondaic.com), 2016-2026
Mondaic Ltd. (info@mondaic.com), 2020-2026
:license:
MIT License
"""
Expand Down
Loading
Loading