Skip to content

Commit

Permalink
Merge pull request sandialabs#93 from sandialabs/move-to-old-test-str…
Browse files Browse the repository at this point in the history
…ucture

Brandon's testing preference.
  • Loading branch information
ralberd authored Oct 18, 2024
2 parents 87d421b + 5fa05da commit 4122fa2
Show file tree
Hide file tree
Showing 78 changed files with 37 additions and 30 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
omit = optimism/test/*
optimism/contact/test/*
optimism/inverse/test/*
optimism/material/test/*
optimism/phasefield/test/*
optimism/treigen/test/*
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: pytest
run: |
pip install -e ".[sparse,test]"
python -m pytest -n auto test --cov=optimism -Wignore
python -m pytest -n auto optimism --cov=optimism -Wignore
# we can also add the flag -n auto for parallel testing
- name: codecov
uses: codecov/codecov-action@v4
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest
from optimism.JaxConfig import *
from ..MeshFixture import MeshFixture
from optimism.test.MeshFixture import MeshFixture
from optimism.contact import Contact
from optimism.contact import Friction
from optimism import Mesh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from optimism.contact import EdgeCpp
from optimism import SmoothFunctions
from ..TestFixture import TestFixture
from optimism.test.TestFixture import TestFixture

doPlotting=False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from optimism.JaxConfig import *
from optimism.contact import EdgeIntersection
from ..TestFixture import TestFixture
from optimism.test.TestFixture import TestFixture


class TestEdgeIntersection(TestFixture):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from optimism.contact import Friction
from optimism.contact import Levelset
from optimism.contact import LevelsetConstraint
from ..MeshFixture import MeshFixture, defaultProps
from optimism.test.MeshFixture import MeshFixture, defaultProps
from optimism import Mechanics
from optimism import FunctionSpace
from optimism import QuadratureRule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..TestFixture import *
from optimism.test.TestFixture import *
from optimism import QuadratureRule
from optimism.contact import MortarContact
import jax
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from numpy.random import rand

from optimism.JaxConfig import *
from ..TestFixture import *
from optimism.test.TestFixture import *
from optimism.NewtonSolver import *
from optimism import AlSolver
from optimism.Objective import Objective
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from optimism import QuadratureRule
from optimism.contact import Search
from optimism.contact import EdgeIntersection
from ..MeshFixture import MeshFixture
from optimism.test.MeshFixture import MeshFixture


def get_best_overlap_vector(mesh, edge, listOfEdges):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from optimism import Surface
from optimism.contact import EdgeIntersection
from optimism import FunctionSpace
from ..MeshFixture import MeshFixture
from optimism.test.MeshFixture import MeshFixture
from optimism.contact import Contact
from matplotlib import pyplot as plt

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from optimism.JaxConfig import *
from optimism import Mesh
from ..MeshFixture import MeshFixture
from optimism.test.MeshFixture import MeshFixture
from optimism.contact import MortarContact
import unittest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..MeshFixture import MeshFixture
from optimism.test.MeshFixture import MeshFixture
from collections import namedtuple
import numpy as onp

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from optimism import QuadratureRule
from optimism import TensorMath

from ..TestFixture import TestFixture
from ..MeshFixture import MeshFixture
from optimism.test.TestFixture import TestFixture
from optimism.test.MeshFixture import MeshFixture

from optimism.inverse import MechanicsInverse

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import jax.numpy as np

from optimism.material import Gent
from .. import TestFixture
from optimism.test import TestFixture


class TestGentMaterial(TestFixture.TestFixture):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from optimism.JaxConfig import *
from optimism.material import J2Plastic
from optimism.material import Hardening
from ..TestFixture import TestFixture
from optimism.test.TestFixture import TestFixture


E = 100.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from matplotlib import pyplot as plt

from optimism.material import HyperViscoelastic as HyperVisco
from ..TestFixture import TestFixture
from optimism.test.TestFixture import TestFixture
from optimism.material import MaterialUniaxialSimulator
from optimism.TensorMath import deviator
from optimism.TensorMath import log_symm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from optimism import Mesh
from optimism import Objective
from optimism import QuadratureRule
from ..TestFixture import TestFixture
from ..MeshFixture import MeshFixture
from optimism.test.TestFixture import TestFixture
from optimism.test.MeshFixture import MeshFixture


plotting=False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import jax.numpy as np

from optimism.material import LinearElastic
from .. import TestFixture
from optimism.test import TestFixture

class TestLinearElasticMaterial(TestFixture.TestFixture):
def setUp(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from optimism.material import MaterialUniaxialSimulator
from optimism.material import LinearElastic
from ..TestFixture import TestFixture
from optimism.test.TestFixture import TestFixture


class MaterialUniaxialSimulatorFixture(TestFixture):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import jax

from optimism.material import Hardening
from ..TestFixture import TestFixture
from optimism.test.TestFixture import TestFixture

class RateSensitivityFixture(TestFixture):
def test_power_law_scales_correctly(self):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from optimism.JaxConfig import *
from optimism import EquationSolver as EqSolver
from optimism import Objective
from .. import TestFixture
from ..MeshFixture import MeshFixture
from optimism.test import TestFixture
from optimism.test.MeshFixture import MeshFixture
from optimism.phasefield import PhaseFieldLorentzPlastic as Model
from optimism import SparseMatrixAssembler
from optimism import TensorMath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from optimism.phasefield import PhaseFieldLorentzPlastic as material
from optimism.phasefield import PhaseField
from optimism.phasefield import MaterialPointSimulator
from .. import MeshFixture
from optimism.test import MeshFixture
from optimism import Mesh
from optimism import AlSolver
from optimism import EquationSolver as EqSolver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from optimism.JaxConfig import *
from optimism import EquationSolver as EqSolver
from optimism import Objective
from .. import TestFixture
from ..MeshFixture import MeshFixture
from optimism.test import TestFixture
from optimism.test.MeshFixture import MeshFixture
from optimism.phasefield import PhaseFieldThreshold as Model
from optimism import SparseMatrixAssembler
from optimism import TensorMath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from optimism.phasefield import PhaseFieldThreshold as material
from optimism.phasefield import PhaseField
from optimism.phasefield import MaterialPointSimulator
from .. import MeshFixture
from optimism.test import MeshFixture
from optimism import Mesh
from optimism import AlSolver
from optimism import EquationSolver as EqSolver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from optimism.JaxConfig import *
from optimism import EquationSolver as EqSolver
from optimism import Objective
from ..TestFixture import TestFixture
from ..MeshFixture import MeshFixture
from optimism.test.TestFixture import TestFixture
from optimism.test.MeshFixture import MeshFixture
from optimism.phasefield import PhaseFieldThresholdPlastic as Model
from optimism import SparseMatrixAssembler
from optimism import TensorMath
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/test_Math.py → optimism/test/test_Math.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import jax.numpy as np

from optimism import Math
from . import TestFixture
from optimism.test import TestFixture

SUM_TESTDATA_FILENAME = os.path.join(os.path.dirname(__file__), 'ill_conditioned_sum_data.npz')
DOTPROD_TESTDATA_FILENAME = os.path.join(os.path.dirname(__file__), 'ill_conditioned_dot_product_data.npz')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4122fa2

Please sign in to comment.