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

pyzag integration #162

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft

pyzag integration #162

wants to merge 28 commits into from

Conversation

reverendbedford
Copy link
Owner

Provide pyzag wrappers for neml2 models and demos on how to train models versus synthetic data.

Copy link

github-actions bot commented Aug 8, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://reverendbedford.github.io/neml2/pr-preview/pr-162/
on branch gh-pages at 2024-08-20 14:18 UTC

@reverendbedford
Copy link
Owner Author

Syntax check

No syntax error, good job! 💜

Copy link

github-actions bot commented Aug 8, 2024

Test Results (ubuntu-latest-Release-ON)

    3 files  ±0      3 suites  ±0   35s ⏱️ ±0s
  533 tests +2    533 ✅ +2  0 💤 ±0  0 ❌ ±0 
3 166 runs  +2  3 166 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 3d2fdb3. ± Comparison against base commit b0b3e88.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 8, 2024

Test Results (macos-12-Debug-ON)

    3 files  ±0      3 suites  ±0   2m 0s ⏱️ +22s
  533 tests +2    533 ✅ +2  0 💤 ±0  0 ❌ ±0 
3 168 runs  +2  3 168 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 3d2fdb3. ± Comparison against base commit b0b3e88.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 8, 2024

Test Results (macos-12-Release-ON)

    3 files  ±0      3 suites  ±0   1m 11s ⏱️ +24s
  533 tests +2    533 ✅ +2  0 💤 ±0  0 ❌ ±0 
3 166 runs  +2  3 166 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 3d2fdb3. ± Comparison against base commit b0b3e88.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 8, 2024

Test Results (ubuntu-latest-Debug-ON)

    3 files  ±0      3 suites  ±0   1m 28s ⏱️ -2s
  533 tests +2    533 ✅ +2  0 💤 ±0  0 ❌ ±0 
3 168 runs  +2  3 168 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 3d2fdb3. ± Comparison against base commit b0b3e88.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 8, 2024

Test Results (macos-12-Debug-OFF)

    3 files  ±0      3 suites  ±0   1m 24s ⏱️ -17s
  533 tests +2    533 ✅ +2  0 💤 ±0  0 ❌ ±0 
3 168 runs  +2  3 168 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 3d2fdb3. ± Comparison against base commit b0b3e88.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 8, 2024

Test Results (ubuntu-latest-Release-OFF)

    3 files  ±0      3 suites  ±0   35s ⏱️ ±0s
  533 tests +2    533 ✅ +2  0 💤 ±0  0 ❌ ±0 
3 166 runs  +2  3 166 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 3d2fdb3. ± Comparison against base commit b0b3e88.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 8, 2024

Test Results (macos-12-Release-OFF)

    3 files  ±0      3 suites  ±0   57s ⏱️ +5s
  533 tests +2    533 ✅ +2  0 💤 ±0  0 ❌ ±0 
3 166 runs  +2  3 166 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 3d2fdb3. ± Comparison against base commit b0b3e88.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 8, 2024

Test Results (ubuntu-latest-Debug-OFF)

    3 files  ±0      3 suites  ±0   1m 24s ⏱️ -4s
  533 tests +2    533 ✅ +2  0 💤 ±0  0 ❌ ±0 
3 168 runs  +2  3 168 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 3d2fdb3. ± Comparison against base commit b0b3e88.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@hugary1995 hugary1995 left a comment

Choose a reason for hiding this comment

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

Cool

src/neml2/models/solid_mechanics/KocksMeckingIntercept.cxx Outdated Show resolved Hide resolved
src/neml2/models/solid_mechanics/KocksMeckingIntercept.cxx Outdated Show resolved Hide resolved
src/neml2/models/solid_mechanics/KocksMeckingIntercept.cxx Outdated Show resolved Hide resolved
tests/unit/models/solid_mechanics/KocksMeckingIntercept.i Outdated Show resolved Hide resolved
python/neml2/pyzag/interface.py Outdated Show resolved Hide resolved
python/neml2/pyzag/interface.py Outdated Show resolved Hide resolved
python/neml2/pyzag/interface.py Outdated Show resolved Hide resolved
python/neml2/pyzag/interface.py Outdated Show resolved Hide resolved
src/neml2/tensors/LabeledMatrix.cxx Outdated Show resolved Hide resolved
Copy link
Collaborator

@hugary1995 hugary1995 left a comment

Choose a reason for hiding this comment

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

A preemptive approve before pyzag arrives.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't want to check in jupyter notebooks. The metadata of the notebook will change everytime you open and save the notebook unless we require users to modify their nb global config.

One approach is to convert jupyter notebooks to python scripts using something like jupytext. They also offer a pre commit hook.

@hugary1995
Copy link
Collaborator

This rich nb diff feature allows me to review nb changes on github: https://github.blog/changelog/2023-03-01-feature-preview-rich-jupyter-notebook-diffs/

Two caveats:

  1. I'm still not a big fan of tracking nb metadata like python version used to run the nb, date and time, execution counts, etc.
  2. Not related to nb, but it seems that the random seed in your nb is not fixed...

@reverendbedford
Copy link
Owner Author

Coverage after merging pyzag_integration_v2 into main will be

93.70%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/neml2/base
   CrossRef.cxx83.87%100%75%100%
   DiagnosticsInterface.cxx71.70%100%66.67%72.73%59, 62–64, 75, 78–80, 83, 86–88
   EnumSelection.cxx100%100%100%100%
   Factory.cxx98.21%100%100%97.83%46
   HITParser.cxx100%100%100%100%
   NEML2Object.cxx91.67%100%100%90%35
   OptionCollection.cxx100%100%100%100%
   OptionSet.cxx100%100%100%100%
   Registry.cxx75%100%66.67%76.92%38, 40–41, 56, 58–59
   Settings.cxx96.49%100%100%96.36%121, 126
src/neml2/drivers
   Driver.cxx91.67%100%100%90%39
   TransientDriver.cxx99%100%100%98.91%102, 272
src/neml2/drivers/solid_mechanics
   LargeDeformationIncrementalSolidMechanicsDriver.cxx94.67%100%100%94.37%63, 81, 83–84
   SolidMechanicsDriver.cxx99.11%100%100%99.07%77
src/neml2/misc
   error.cxx100%100%100%100%
   math.cxx95.74%100%93.55%96.18%249, 315, 317–318, 341, 343
   parser_utils.cxx98.46%100%100%98.18%64
   types.cxx100%100%100%100%
   utils.cxx90.91%100%100%88.24%52, 60
src/neml2/models
   ArrheniusParameter.cxx97.22%100%100%96.97%54
   BackwardEulerTimeIntegration.cxx92.59%100%75%97.62%56
   BufferStore.cxx73.33%100%66.67%75%36, 38, 40
   ComposedModel.cxx91.98%100%100%91.44%233, 235, 367, 375, 377–378, 386–387, 390, 392, 394, 396–399, 406, 417, 62, 99
   ConstantParameter.cxx52.11%100%40.74%88.24%43, 61
   CopyVariable.cxx54.05%100%38.89%95%46
   Data.cxx90%100%100%87.50%35
   ForwardEulerTimeIntegration.cxx86.27%100%66.67%92.31%55, 64, 96
   ImplicitUpdate.cxx95.51%100%100%95.18%122, 135, 172, 48
   InputParameter.cxx52.05%100%37.04%94.74%42
   LinearCombination.cxx94.44%100%75%100%
   LinearInterpolation.cxx91.43%100%77.78%96.15%41
   Model.cxx96.60%100%97.83%96.45%246, 317, 52, 544, 581, 617, 644, 646–648, 650–651, 674
   NonlinearParameter.cxx61.90%100%55.56%100%
   ParameterStore.cxx73.68%100%37.04%85.06%112, 138, 185, 187–188, 191–192, 199, 57, 59–61, 89
   RotationMatrix.cxx96%100%100%95.45%45
   SR2Invariant.cxx92.59%100%100%92.31%119, 144, 159–160, 77, 93
   SmoothLinearInterpolation.cxx14.75%100%20%13.04%100–104, 44, 47, 49–57, 59, 63, 65–68, 72, 74–77, 81, 83, 85–88, 90, 92–95, 97–98
   VariableRate.cxx90.74%100%66.67%97.62%53
   VariableStore.cxx100%100%100%100%
   WR2ExplicitExponentialTimeIntegration.cxx79.17%100%75%79.55%50, 59, 66, 68–72, 93
   WR2ImplicitExponentialTimeIntegration.cxx96.08%100%100%95.74%57, 66
src/neml2/models/crystallography
   CrystalGeometry.cxx98.46%100%100%98.25%197, 59
   CubicCrystal.cxx93.75%100%100%92.86%51
   MillerIndex.cxx100%100%100%100%
   crystallography.cxx98.28%100%100%98.08%127
src/neml2/models/crystallography/user_tensors
   FillMillerIndex.cxx94.44%100%100%93.33%44
   SymmetryFromOrbifold.cxx93.33%100%100%92.31%47
src/neml2/models/solid_mechanics
   AssociativeIsotropicPlasticHardening.cxx96.67%100%100%96.30%50
   AssociativeKinematicPlasticHardening.cxx96.88%100%100%96.55%52
   AssociativePlasticFlow.cxx96.55%100%100%96.15%50
   ChabochePlasticHardening.cxx97.22%100%100%96.97%50
   Eigenstrain.cxx90.91%100%100%88.89%38
   Elasticity.cxx96%100%100%95.65%52
   FlowRule.cxx92.31%100%100%90.91%40
   FredrickArmstrongPlasticHardening.cxx97.87%100%100%97.73%62
   GTNYieldFunction.cxx99.50%100%100%99.49%75
   GursonCavitation.cxx96.97%100%100%96.67%49
   IsotropicHardening.cxx93.33%100%100%92.31%42
   IsotropicHardeningStaticRecovery.cxx94.74%100%100%94.12%44
   IsotropicMandelStress.cxx93.33%100%100%92.31%40
   KinematicHardening.cxx93.33%100%100%92.31%42
   KinematicHardeningStaticRecovery.cxx94.44%100%100%93.75%45
   KocksMeckingActivationEnergy.cxx97.73%100%100%97.56%63
   KocksMeckingFlowSwitch.cxx97.83%100%100%97.67%60
   KocksMeckingFlowViscosity.cxx98.86%100%100%98.82%65
   KocksMeckingIntercept.cxx97.73%100%100%97.56%51
   KocksMeckingRateSensitivity.cxx98.28%100%100%98.18%54
   KocksMeckingYieldStress.cxx96.88%100%100%96.55%47
   LinearIsotropicElasticity.cxx97.73%100%100%97.56%50
   LinearIsotropicHardening.cxx95.24%100%100%94.44%42
   LinearKinematicHardening.cxx95.24%100%100%94.44%43
   MandelStress.cxx93.33%100%100%92.31%42
   MixedControlSetup.cxx98.18%100%100%98.04%64
   Normality.cxx98.18%100%100%98.04%52
   OlevskySinteringStress.cxx96.97%100%100%96.67%54
   PerzynaPlasticFlowRate.cxx97.22%100%100%96.97%49
   PlasticFlowRate.cxx92.86%100%100%91.67%41
   PowerLawIsotropicHardeningStaticRecovery.cxx96.97%100%100%96.67%46
   PowerLawKinematicHardeningStaticRecovery.cxx97.14%100%100%96.88%51
   RateIndependentPlasticFlowConstraint.cxx96.97%100%100%96.67%47
   SlopeSaturationVoceIsotropicHardening.cxx97.62%100%100%97.44%58
   ThermalEigenstrain.cxx85.29%100%100%83.87%51, 78–79, 81–82
   TwoStageThermalAnnealing.cxx100%100%100%100%
   VoceIsotropicHardening.cxx96.77%100%100%96.43%46
   YieldFunction.cxx97.50%100%100%97.30%53
src/neml2/models/solid_mechanics/crystal_plasticity
   ElasticStrainRate.cxx97.67%100%100%97.50%62
   FixOrientation.cxx96.97%100%100%96.67%55
   LinearSingleSlipHardeningRule.cxx95.45%100%100%94.74%44
   OrientationRate.cxx97.67%100%100%97.50%62
   PlasticDeformationRate.cxx97.44%100%100%97.22%62
   PlasticVorticity.cxx97.37%100%100%97.14%61
   PowerLawSlipRule.cxx97.06%100%100%96.77%51
   ResolvedShear.cxx97.50%100%100%97.30%59
   SingleSlipHardeningRule.cxx95.24%100%100%94.74%52
   SingleSlipStrengthMap.cxx96%100%100%95.45%49
   SlipRule.cxx95.83%100%100%95.45%55
   SlipStrengthMap.cxx94.12%100%100%93.33%47
   SumSlipRates.cxx96.77%100%100%96.43%55
   VoceSingleSlipHardeningRule.cxx96.43%100%100%96%48
src/neml2/solvers
   Newton.cxx90.38%100%100%88.89%40, 59, 61–62, 64
   NewtonWithLineSearch.cxx90.20%100%100%89.36%53, 89–92
   NewtonWithTrustRegion.cxx88.68%100%100%87.76%109, 149–155, 182–184, 78
   NonlinearSolver.cxx94.44%100%100%93.75%45
   NonlinearSystem.cxx89.60%100%93.75%88.99%104–105, 124–125, 166, 168–170, 51, 85, 95–96
   Solver.cxx91.67%100%100%90%39
   TrustRegionSubProblem.cxx100%100%100%100%
src/neml2/tensors
   LabeledAxis.cxx80.63%100%91.67%79.29%137, 153, 157–159, 179, 189, 216, 268, 270, 272–274, 276–278, 280–281, 299, 312–313, 317, 335, 351, 357, 360, 367, 370–372, 374–378, 381, 384–386, 389–390
   LabeledAxisAccessor.cxx97.33%100%100%96.61%109–110
   LabeledMatrix.cxx100%100%100%100%
   LabeledTensor.cxx67.90%100%52.99%81.75%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants