Skip to content

Commit

Permalink
Merge pull request #129 from adtzlr/update-toml-version-string
Browse files Browse the repository at this point in the history
Update `pyproject.toml`, gh-actions and store version string only once
  • Loading branch information
adtzlr authored Jan 3, 2023
2 parents 8e2ed49 + 6b50a7e commit d9cb678
Show file tree
Hide file tree
Showing 25 changed files with 159 additions and 229 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- name: Setup Python
uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Test with tox
run: |
pip install tox
tox -- --cov matadi --cov-report xml --cov-report term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == '3.10' }}
5 changes: 2 additions & 3 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
Expand All @@ -32,5 +32,4 @@ jobs:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2021 <name of author>
Copyright (C) 2023 Andreas Dutzler

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

matadi Copyright (C) 2021 Andreas Dutzler
matadi Copyright (C) 2023 Andreas Dutzler
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
2 changes: 1 addition & 1 deletion matadi/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.14"
__version__ = "0.1.15"
42 changes: 17 additions & 25 deletions matadi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
from .__about__ import __version__

import casadi

from .__about__ import __version__

Variable = casadi.SX.sym

from ._material import (
Function,
Function as FunctionScalar,
FunctionTensor,
Material,
Material as MaterialScalar,
MaterialTensor,
)
from . import models
from . import math
from . import math, models
from ._lab_compressible import LabCompressible
from ._lab_compressible import LabCompressible as Lab
from ._lab_incompressible import LabIncompressible
from ._material import Function
from ._material import Function as FunctionScalar
from ._material import FunctionTensor
from ._material import Material
from ._material import Material as MaterialScalar
from ._material import MaterialTensor
from ._templates import (
TwoFieldVariation,
TwoFieldVariationPlaneStrain,
ThreeFieldVariation,
ThreeFieldVariationPlaneStrain,
MaterialHyperelastic,
MaterialComposite,
MaterialHyperelastic,
MaterialHyperelasticPlaneStrain,
MaterialHyperelasticPlaneStressIncompressible,
MaterialHyperelasticPlaneStressLinearElastic,
MaterialTensorGeneral,
ThreeFieldVariation,
ThreeFieldVariationPlaneStrain,
TwoFieldVariation,
TwoFieldVariationPlaneStrain,
)
from ._lab_compressible import (
LabCompressible,
LabCompressible as Lab,
)
from ._lab_incompressible import (
LabIncompressible,
)


__all__ = [
"__version__",
Expand Down
5 changes: 3 additions & 2 deletions matadi/_lab_compressible.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import matplotlib.pyplot as plt
from collections import namedtuple

import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import root


Expand Down
5 changes: 3 additions & 2 deletions matadi/_lab_incompressible.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import matplotlib.pyplot as plt
from collections import namedtuple

import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import root


Expand Down
4 changes: 2 additions & 2 deletions matadi/_material.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from multiprocessing import cpu_count

import numpy as np
import casadi as ca
import numpy as np

from ._apply import apply
from . import Variable
from ._apply import apply


class Function:
Expand Down
7 changes: 5 additions & 2 deletions matadi/_templates.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import numpy as np

from . import Material, MaterialTensor, Variable
from .math import det, horzcat, vertcat, zeros, gradient as grad, trace, eye, Function
from . import Variable
from ._material import Material, MaterialTensor
from .math import Function, det, eye
from .math import gradient as grad
from .math import horzcat, trace, vertcat, zeros


class TwoFieldVariation:
Expand Down
109 changes: 53 additions & 56 deletions matadi/math.py
Original file line number Diff line number Diff line change
@@ -1,73 +1,70 @@
from casadi import (
# tensor and vector operations
det,
inv,
dot as _dot,
transpose,
trace,
diag,
triu,
tril,
DM,
MX,
SX,
Function,
acos,
acosh,
adj,
cofactor,
cross,
times,
eig_symbolic,
qr,
ldl,
# trig
sin,
cos,
tan,
sinh,
cosh,
tanh,
asin,
acos,
asinh,
atan,
atan2,
asinh,
acosh,
atanh,
# math
exp,
log,
sqrt,
sum1,
sum2,
sumsqr,
pi,
fabs,
linspace,
ceil,
cofactor,
cos,
cosh,
cross,
det,
diag,
)
from casadi import dot as _dot # tensor and vector operations; trig; math
from casadi import (
eig_symbolic,
erf,
erfinv,
norm_1,
sign,
fmin,
fmax,
mmin,
mmax,
exp,
fabs,
find,
#
if_else,
logic_and,
logic_or,
logic_not,
floor,
ceil,
SX,
DM,
MX,
#
vertcat,
fmax,
fmin,
gradient,
hessian,
horzcat,
vertsplit,
horzsplit,
if_else,
inv,
ldl,
linspace,
log,
logic_and,
logic_not,
logic_or,
mmax,
mmin,
norm_1,
pi,
qr,
repmat,
reshape,
gradient,
hessian,
Function,
sign,
sin,
sinh,
sqrt,
sum1,
sum2,
sumsqr,
tan,
tanh,
times,
trace,
transpose,
tril,
triu,
vertcat,
vertsplit,
)

eye = SX.eye
Expand Down
34 changes: 12 additions & 22 deletions matadi/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
from . import microsphere
from ._helpers import (
displacement_pressure_split,
isochoric_volumetric_split,
volumetric,
displacement_pressure_split,
)

from ._hyperelasticity_anisotropic import fiber, fiber_family, holzapfel_gasser_ogden
from ._hyperelasticity_isotropic import (
arruda_boyce,
extended_tube,
linear_elastic,
saint_venant_kirchhoff,
neo_hooke,
mooney_rivlin,
yeoh,
third_order_deformation,
neo_hooke,
ogden,
arruda_boyce,
extended_tube,
saint_venant_kirchhoff,
third_order_deformation,
van_der_waals,
yeoh,
)

from ._hyperelasticity_anisotropic import (
fiber,
fiber_family,
holzapfel_gasser_ogden,
)

from ._viscoelasticity import finite_strain_viscoelastic

from ._pseudo_elasticity import ogden_roxburgh
from ._misc import morph

from . import microsphere
from ._pseudo_elasticity import ogden_roxburgh
from ._templates import Morph, NeoHookeOgdenRoxburgh, Viscoelastic
from ._viscoelasticity import finite_strain_viscoelastic
from .microsphere.nonaffine import miehe_goektepe_lulei

from ._templates import NeoHookeOgdenRoxburgh, Morph, Viscoelastic
4 changes: 2 additions & 2 deletions matadi/models/_helpers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from functools import wraps
from copy import deepcopy
from functools import wraps

from .. import Variable
from ..math import det, cof, trace, gradient
from ..math import cof, det, gradient, trace


def isochoric_volumetric_split(fun):
Expand Down
14 changes: 7 additions & 7 deletions matadi/models/_hyperelasticity_anisotropic.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from ._helpers import isochoric_volumetric_split
from ..math import (
transpose,
det,
DM,
cos,
det,
exp,
if_else,
invariants,
log,
cos,
sin,
pi,
sin,
sqrt,
if_else,
invariants,
trace,
transpose,
)
from ._helpers import isochoric_volumetric_split


@isochoric_volumetric_split
Expand Down
2 changes: 1 addition & 1 deletion matadi/models/_hyperelasticity_isotropic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..math import det, dot, eigvals, eye, log, sqrt, sum1, sym, trace, transpose
from ._helpers import isochoric_volumetric_split
from ..math import dot, det, transpose, trace, eigvals, sum1, log, sqrt, eye, sym


def linear_elastic(F, mu, lmbda):
Expand Down
Loading

0 comments on commit d9cb678

Please sign in to comment.