diffpes.types tests¶
Validation and regression tests for diffpes.types.
Test the public scalar type aliases.
Extended Summary¶
Maintains a source-mirroring test module for the annotation-only definitions
in diffpes.types.aliases. The typed public APIs exercise these aliases
at runtime throughout the test suite.
Validate band, projection, spin, and ARPES carriers and factories.
The cases cover JAX PyTree behavior, eager and compiled construction, gradient-transparent validation, optional spin and OAM data, and shape and finiteness rejection contracts.
- class tests.test_diffpes.test_types.test_bands.TestBandStructure[source]¶
Bases:
objectValidate
BandStructureas a JAX PyTree.Eigenvalues, k-points, weights, and the Fermi energy must remain numerical leaves with stable dimensions through JAX transformations.
- See:
- test_pytree_round_trip() None[source]¶
Preserve all band fields through JAX reconstruction.
The check compares a two-point, two-band structure and its nonuniform k-point weights before and after a PyTree round trip.
Notes
The test constructs the carrier through its factory, flattens and unflattens it with JAX, and compares every array leaf with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_bands.TestOrbitalProjection[source]¶
Bases:
objectValidate
OrbitalProjectionoptional leaves.Projection weights must remain present while omitted spin and OAM arrays remain empty subtrees.
- See:
- test_preserves_absent_optional_fields() None[source]¶
Store a nine-orbital projection with no spin or OAM data.
The check verifies the exact projection shape and both
Nonesentinels for a non-spin calculation.Notes
The test constructs one projection through its public factory and uses Chex for the array shape plus direct identity checks for optional fields.
- Return type:
- class tests.test_diffpes.test_types.test_bands.TestSpinOrbitalProjection[source]¶
Bases:
objectValidate
SpinOrbitalProjectionas a PyTree.Mandatory spin projections and optional orbital angular momentum must survive JAX reconstruction with their component axes intact.
- test_pytree_round_trip_with_oam() None[source]¶
Preserve spin and OAM arrays through JAX reconstruction.
The check uses six spin channels and three OAM components for a two-point, three-band, one-atom projection.
Notes
The test constructs the spin carrier through its factory, performs a JAX tree round trip, and compares all three array leaves with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_bands.TestSpinBandStructure[source]¶
Bases:
objectValidate
SpinBandStructureas a JAX PyTree.Up- and down-spin eigenvalues must share their k-point coordinates and survive reconstruction together.
- See:
- test_pytree_round_trip() None[source]¶
Preserve both spin channels through JAX reconstruction.
The check compares two five-by-three eigenvalue arrays and their scalar Fermi energy before and after a PyTree round trip.
Notes
The test constructs the spin-resolved carrier, applies JAX flatten and unflatten, and compares both energy channels with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_bands.TestArpesSpectrum[source]¶
Bases:
objectValidate
ArpesSpectrumarray storage.The momentum-energy intensity map must retain its association with the strictly increasing energy axis.
- See:
- test_stores_intensity_and_energy_axis() None[source]¶
Preserve a two-point, eight-energy-bin ARPES spectrum.
The check verifies the exact two-dimensional intensity and one-dimensional energy-axis shapes.
Notes
The test constructs the spectrum through its public factory and checks both numerical dimensions with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_bands.TestMakeBandStructure(*args, **kwargs) None[source]¶
Bases:
TestCaseValidate
make_band_structure()under JAX.The factory must supply uniform weights, normalize scalar dtype, preserve gradients, and reject non-finite eigenvalues in eager and compiled modes.
- test_rejects_nonfinite_eigenvalues() None[source]¶
Reject a NaN eigenvalue in eager and compiled execution.
The check gates the value-threaded
eqx.error_ifvalidation rather than allowing a poisoned carrier to escape.Notes
The test calls the raw and
eqx.filter_jitfactories with one NaN eigenvalue and matches the same runtime diagnostic in both modes.- Return type:
- test_validation_preserves_gradient() None[source]¶
Preserve the unit gradient through valid eigenvalue checking.
The derivative of the sum of two validated eigenvalues must match the direct array-sum derivative exactly.
Notes
The test differentiates an independently defined sum through the carrier factory and compares it with
jax.grad(jnp.sum)using Chex.- Return type:
- test_constructs_uniform_weights__with_jit() None¶
Construct uniform weights in eager and compiled execution.
The check expects eight unit weights and a scalar JAX Fermi energy for an eight-point, three-band input.
Notes
The test wraps the public factory with
self.variantand compares output shapes, weights, and scalar array type with Chex.- Return type:
- test_constructs_uniform_weights__without_jit() None¶
Construct uniform weights in eager and compiled execution.
The check expects eight unit weights and a scalar JAX Fermi energy for an eight-point, three-band input.
Notes
The test wraps the public factory with
self.variantand compares output shapes, weights, and scalar array type with Chex.- Return type:
- class tests.test_diffpes.test_types.test_bands.TestMakeOrbitalProjection[source]¶
Bases:
objectValidate
make_orbital_projection().The factory must accept compatible spin data and reject malformed orbital axes or negative projection probabilities.
- test_stores_optional_spin() None[source]¶
Preserve the six-channel optional spin projection array.
The check verifies a four-point, three-band, one-atom spin array shape alongside the mandatory nine-orbital weights.
Notes
Supplies compatible projection and spin arrays to the public factory and checks the stored spin dimensions with Chex.
- Return type:
- test_rejects_invalid_projection_values() None[source]¶
Reject a wrong orbital axis and negative projection weights.
The check covers the static nine-orbital convention and the traced nonnegative-probability contract.
Notes
The test uses the rejection helper with an eight-orbital tensor and then with a negative nine-orbital tensor, matching each diagnostic.
- Return type:
- class tests.test_diffpes.test_types.test_bands.TestMakeSpinOrbitalProjection[source]¶
Bases:
objectValidate
make_spin_orbital_projection().The spin-specific factory must require compatible six-channel spin data and preserve an optional three-component OAM array.
- test_stores_explicit_oam() None[source]¶
Preserve a three-component orbital-angular-momentum array.
The check verifies the
2 x 3 x 1 x 3OAM shape and float64 dtype after factory normalization.Notes
Supplies compatible projection, spin, and OAM arrays and checks the optional output leaf with Chex and a dtype comparison.
- Return type:
- test_rejects_negative_projection_values() None[source]¶
Reject negative orbital probabilities with valid spin dimensions.
The check isolates the traced nonnegative constraint of the spin-aware factory.
Notes
Supplies a negative nine-orbital tensor and a compatible zero spin tensor, then matches the factory’s probability diagnostic.
- Return type:
- class tests.test_diffpes.test_types.test_bands.TestMakeSpinBandStructure[source]¶
Bases:
objectValidate
make_spin_band_structure().The factory must align both spin channels with one k-point mesh and reject negative integration weights.
- test_constructs_aligned_spin_channels() None[source]¶
Construct equal-shape up- and down-spin eigenvalue arrays.
The check verifies both channels retain the requested four-point, two-band dimensions.
Notes
Supplies finite spin channels and common k-points, then checks their carrier shapes with Chex.
- Return type:
- test_rejects_negative_weights() None[source]¶
Reject a negative spin-band integration weight.
The check isolates the traced nonnegative-weight contract for one k-point and one band in each spin channel.
Notes
The test uses the rejection helper with compatible spin arrays and a single negative weight, matching the factory diagnostic.
- Return type:
- class tests.test_diffpes.test_types.test_bands.TestMakeArpesSpectrum[source]¶
Bases:
objectValidate
make_arpes_spectrum().The factory must preserve intensity dimensions and reject non-increasing energy coordinates.
- test_constructs_spectrum_shapes() None[source]¶
Construct ten momentum points over 100 energy bins.
The check gates the exact two-dimensional intensity and one-dimensional energy-axis shapes after float64 normalization.
Notes
Supplies a zero intensity map and linearly spaced energy axis, then checks both output dimensions with Chex.
- Return type:
- test_rejects_unsorted_energy_axis() None[source]¶
Reject repeated ARPES energy coordinates.
The check verifies strict energy ordering independently of the finite intensity map.
Notes
Supplies two equal energy coordinates and matches the traced ordering diagnostic through the shared rejection helper.
- Return type:
Test the JAX-native certification carrier contract.
The tests cover public behavior, differentiability, validation, and stable scientific identity in the supported certification regime.
- class tests.test_diffpes.test_types.test_certification.TestArtifactref[source]¶
Bases:
objectVerify
ArtifactRef.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
ArtifactRefthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestCertificationclaim[source]¶
Bases:
objectVerify
CertificationClaim.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
CertificationClaimthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestCertificationcontext[source]¶
Bases:
objectVerify
CertificationContext.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
CertificationContextthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestCheckfunction[source]¶
Bases:
objectVerify
CheckFunction.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
CheckFunctionthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestCertifiedresult[source]¶
Bases:
objectVerify
CertifiedResult.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
CertifiedResultthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- test_complete_result_round_trips_through_filter_jit() None[source]¶
Preserve the complete nested PyTree through compiled execution.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestConventionref[source]¶
Bases:
objectVerify
ConventionRef.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
ConventionRefthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestDependencymap[source]¶
Bases:
objectVerify
DependencyMap.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
DependencyMapthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestDerivativeevidence[source]¶
Bases:
objectVerify
DerivativeEvidence.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
DerivativeEvidencethrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestDomainpredicate[source]¶
Bases:
objectVerify
DomainPredicate.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
DomainPredicatethrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestDomainresult[source]¶
Bases:
objectVerify
DomainResult.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
DomainResultthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestEvidenceref[source]¶
Bases:
objectVerify
EvidenceRef.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
EvidenceRefthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestEvidencereport[source]¶
Bases:
objectVerify
EvidenceReport.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
EvidenceReportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestExecutionmanifest[source]¶
Bases:
objectVerify
ExecutionManifest.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
ExecutionManifestthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestForwardcertificate[source]¶
Bases:
objectVerify
ForwardCertificate.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
ForwardCertificatethrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- test_complete_graph_has_traced_numerical_leaves() None[source]¶
Verify every dynamic leaf in a complete certificate is a JAX array.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test constructs the shared complete fixture and inspects its flattened JAX leaves while static vocabulary remains outside the numerical tree.
- Return type:
- test_static_vocabulary_is_absent_from_numerical_leaves() None[source]¶
Keep identifiers static while retaining all numerical evidence.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestForwardmodelspec[source]¶
Bases:
objectVerify
ForwardModelSpec.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
ForwardModelSpecthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestInformationspectrum[source]¶
Bases:
objectVerify
InformationSpectrum.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
InformationSpectrumthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestPolicyreport[source]¶
Bases:
objectVerify
PolicyReport.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
PolicyReportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestRegisteredmodel[source]¶
Bases:
objectVerify
RegisteredModel.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
RegisteredModelthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestRegisteredtransformation[source]¶
Bases:
objectVerify
RegisteredTransformation.The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
RegisteredTransformationthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestRegistryreport[source]¶
Bases:
objectVerify
RegistryReport.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
RegistryReportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestRegistrysnapshot[source]¶
Bases:
objectVerify
RegistrySnapshot.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
RegistrySnapshotthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestReproductionreport[source]¶
Bases:
objectVerify
ReproductionReport.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
ReproductionReportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestSensitivitymap[source]¶
Bases:
objectVerify
SensitivityMap.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
SensitivityMapthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestTransformationrecord[source]¶
Bases:
objectVerify
TransformationRecord.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
TransformationRecordthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestVerificationreport[source]¶
Bases:
objectVerify
VerificationReport.The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
VerificationReportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeArtifactRef[source]¶
Bases:
objectVerify
make_artifact_ref().The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_artifact_refthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeCertificationClaim[source]¶
Bases:
objectVerify
make_certification_claim().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_certification_claimthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- test_continuous_claim_evidence_is_differentiable() None[source]¶
Differentiate a smooth residual and margin through its factory.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeCertificationContext[source]¶
Bases:
objectVerify
make_certification_context().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_certification_contextthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- test_context_cross_validates_model_identity() None[source]¶
Reject prepared contexts that combine different model identities.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeCertifiedResult[source]¶
Bases:
objectVerify
make_certified_result().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_certified_resultthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- test_certified_envelope_preserves_primal_jvp_and_vjp() None[source]¶
Show that attaching a certificate does not alter model derivatives.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeConventionRef[source]¶
Bases:
objectVerify
make_convention_ref().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_convention_refthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeDependencyMap[source]¶
Bases:
objectVerify
make_dependency_map().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_dependency_mapthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeDerivativeEvidence[source]¶
Bases:
objectVerify
make_derivative_evidence().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_derivative_evidencethrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeDomainPredicate[source]¶
Bases:
objectVerify
make_domain_predicate().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_domain_predicatethrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeDomainResult[source]¶
Bases:
objectVerify
make_domain_result().The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_domain_resultthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- test_domain_results_vmap_with_traced_status_and_margin() None[source]¶
Batch domain checks without concretizing status arrays.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeEvidenceRef[source]¶
Bases:
objectVerify
make_evidence_ref().The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_evidence_refthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- test_factories_reject_bad_numerical_shapes_and_tolerances() None[source]¶
Reject malformed evidence eagerly and through compiled execution.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeEvidenceReport[source]¶
Bases:
objectVerify
make_evidence_report().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_evidence_reportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeExecutionManifest[source]¶
Bases:
objectVerify
make_execution_manifest().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_execution_manifestthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeForwardCertificate[source]¶
Bases:
objectVerify
make_forward_certificate().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_forward_certificatethrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- test_certificate_rejects_cross_record_inconsistency() None[source]¶
Reject policy, dependency, and duplicate identity mismatches.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeForwardModelSpec[source]¶
Bases:
objectVerify
make_forward_model_spec().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_forward_model_specthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- test_factories_reject_malformed_static_structure() None[source]¶
Reject empty identities, invalid JSON, and overlapping path classes.
The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeInformationSpectrum[source]¶
Bases:
objectVerify
make_information_spectrum().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_information_spectrumthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakePolicyReport[source]¶
Bases:
objectVerify
make_policy_report().The cases cover the public carrier or factory contract in JAX PyTrees.
- See:
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_policy_reportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeRegisteredModel[source]¶
Bases:
objectVerify
make_registered_model().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_registered_modelthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeRegisteredTransformation[source]¶
Bases:
objectVerify
make_registered_transformation().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_registered_transformationthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeRegistryReport[source]¶
Bases:
objectVerify
make_registry_report().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_registry_reportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeRegistrySnapshot[source]¶
Bases:
objectVerify
make_registry_snapshot().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_registry_snapshotthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeReproductionReport[source]¶
Bases:
objectVerify
make_reproduction_report().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_reproduction_reportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeSensitivityMap[source]¶
Bases:
objectVerify
make_sensitivity_map().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_sensitivity_mapthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeTransformationRecord[source]¶
Bases:
objectVerify
make_transformation_record().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_transformation_recordthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestMakeVerificationReport[source]¶
Bases:
objectVerify
make_verification_report().The cases cover the public carrier or factory contract in JAX PyTrees.
- test_public_symbol_has_expected_kind() None[source]¶
Expose
make_verification_reportthrough its canonical types package path.The case uses explicit inputs in the supported certification regime. It checks the public result or the documented failure state.
Notes
The test compares the result with explicit numerical or structural assertions.
- Return type:
- class tests.test_diffpes.test_types.test_certification.TestArtifactResolver[source]¶
Bases:
objectVerify
ArtifactResolver.The case checks the canonical types package path for the resolver alias.
- See:
- class tests.test_diffpes.test_types.test_certification.TestRegistrationHandshake[source]¶
Bases:
objectVerify
RegistrationHandshake.The case checks the canonical type identity for registration requirements.
- class tests.test_diffpes.test_types.test_certification.TestHandshakeReport[source]¶
Bases:
objectVerify
HandshakeReport.The case checks the JAX-native report carrier for handshake validation.
- See:
- class tests.test_diffpes.test_types.test_certification.TestWaiverRecord[source]¶
Bases:
objectVerify
WaiverRecord.The case checks the static carrier for a bounded policy waiver.
- See:
- class tests.test_diffpes.test_types.test_certification.TestWaiverReport[source]¶
Bases:
objectVerify
WaiverReport.The case checks the JAX-native carrier for temporal waiver validation.
- See:
- class tests.test_diffpes.test_types.test_certification.TestMakeRegistrationHandshake[source]¶
Bases:
objectVerify
make_registration_handshake().The case checks construction of declarative owner requirements.
- class tests.test_diffpes.test_types.test_certification.TestMakeHandshakeReport[source]¶
Bases:
objectVerify
make_handshake_report().The case checks the JAX Boolean outcome and static missing references.
- class tests.test_diffpes.test_types.test_certification.TestMakeWaiverRecord[source]¶
Bases:
objectVerify
make_waiver_record().The case checks construction of a bounded policy-waiver declaration.
- See:
- class tests.test_diffpes.test_types.test_certification.TestMakeWaiverReport[source]¶
Bases:
objectVerify
make_waiver_report().The case checks the JAX Boolean outcomes for temporal validation.
- See:
Validate centralized parser, orbital, and tabulated-data constants.
The cases check immutable VASP conventions and alignment of the bundled photoionization cross-section rows against independent shape relationships.
- class tests.test_diffpes.test_types.test_constants.TestOrbitalConstants[source]¶
Bases:
objectValidate the shared VASP orbital-ordering constants.
Indices, slices, and direction rows must describe one nine-orbital basis with the scalar orbital first.
- See:
ORBITAL_INDEX- See:
ORBITAL_DIRS_NORMALIZED
Keep orbital indices, slices, and direction rows aligned.
The check verifies nine immutable indices, the standard p and d slices, and a zero direction for the scalar orbital.
Notes
The test compares the public mapping and slice constants exactly, then uses Chex for the direction-table shape and scalar-orbital row.
- Return type:
- class tests.test_diffpes.test_types.test_constants.TestParserConstants[source]¶
Bases:
objectValidate immutable parser tokens and angular-momentum bounds.
The tests verify shared coordinate selectors and the maximum orbital angular momentum. Parsers do not define local values for these conventions.
- See:
COORDINATE_MODE_TOKENS- See:
L_MAX
- test_tokens_are_immutable_conventions() None[source]¶
Preserve the coordinate-token set and maximum angular momentum.
The check expects a frozen four-token convention and
L_MAX=4.Notes
The test compares the public token container type and contents plus the integer angular-momentum bound against independent literal values.
- Return type:
- class tests.test_diffpes.test_types.test_constants.TestCrossSectionTables[source]¶
Bases:
objectValidate alignment of the bundled photoionization tables.
Every s-, p-, and d-channel cross section must provide one value at each shared photon-energy node.
- See:
CROSS_SECTION_ENERGIES
Align every cross-section channel with the energy coordinates.
The check verifies three energy nodes and an equal one-dimensional shape for every angular-momentum channel.
Notes
The test iterates over the three independent public channel arrays and uses Chex to compare each shape with the energy table.
- Return type:
Validate workflow-context storage and cross-carrier consistency.
The cases cover the immutable context boundary and rejection of band and projection dimensions that cannot describe the same simulation.
- class tests.test_diffpes.test_types.test_context.TestWorkflowContext[source]¶
Bases:
objectValidate
WorkflowContextfield storage.The carrier must keep compatible bands and projections together while retaining absent optional metadata as
None.- See:
- test_stores_compatible_members() None[source]¶
Preserve compatible workflow members and optional defaults.
The check verifies carrier identity and the two absent optional fields for a one-k-point, one-band workflow.
Notes
The test builds both members with their public factories, constructs the context, and compares the stored objects and
Nonesentinels.- Return type:
- class tests.test_diffpes.test_types.test_context.TestMakeWorkflowContext[source]¶
Bases:
objectValidate
make_workflow_context().The factory must reject band and projection carriers with inconsistent k-point or band dimensions.
- test_rejects_band_projection_mismatch() None[source]¶
Reject workflow members with inconsistent K/B dimensions.
The check covers the static leading-dimension contract between band eigenvalues and orbital projection weights.
Notes
The test constructs independently valid carriers with incompatible k-point counts and matches the factory’s dimension diagnostic.
- Return type:
Validate static transformation-contract carriers and their factories.
The cases cover immutable field storage, validity consistency, and the
identity and semantic-term rejection rules owned by diffpes.types.
- class tests.test_diffpes.test_types.test_contracts.TestTransformationContract[source]¶
Bases:
objectValidate
TransformationContractstorage.The carrier must preserve the normalized static semantic contract returned by its public factory.
- test_stores_static_semantics() None[source]¶
Preserve every declared semantic term without reordering it.
The check verifies the carrier fields against explicitly supplied semantic labels and the declared JAX-purity flag.
Notes
The test constructs one contract through the validated factory and compares its immutable tuples and Boolean flag with the independent input values.
- Return type:
- class tests.test_diffpes.test_types.test_contracts.TestCompositionReport[source]¶
Bases:
objectValidate
CompositionReportstorage.The carrier must expose the cumulative semantics and transformation order recorded by its public factory.
- See:
- test_stores_composition_state() None[source]¶
Preserve successful composition state and ordered references.
The check verifies that an error-free report retains its final semantic set and transformation order exactly.
Notes
The test builds a valid report with two transformation references and compares each static field with the independently specified tuples.
- Return type:
- class tests.test_diffpes.test_types.test_contracts.TestMakeTransformationContract[source]¶
Bases:
objectValidate
make_transformation_contract().The factory must reject malformed identities, duplicate terms, and contradictory preservation and destruction declarations.
- test_rejects_invalid_contracts(kwargs: dict[str, object], message: str) None[source]¶
Reject every malformed static contract declaration.
The parameter table covers invalid identities and versions, duplicate terms, and mutually contradictory information-flow declarations.
Notes
The test calls the factory once for each invalid declaration. It matches the diagnostic text and identifies each static branch.
- Return type:
- class tests.test_diffpes.test_types.test_contracts.TestMakeCompositionReport[source]¶
Bases:
objectValidate
make_composition_report().The factory must keep its validity flag equivalent to an empty error set.
- test_rejects_inconsistent_validity() None[source]¶
Reject a successful flag paired with composition errors.
The check isolates the factory invariant that
validis true if and only if the error sequence is empty.Notes
The test supplies one explicit error with
valid=True. It matches the consistency diagnostic before report construction.- Return type:
Validate density-of-states carriers and their public factories.
The cases cover JIT construction, full-carrier PyTree reconstruction, and the strictly increasing energy-axis contract shared by both factories.
- class tests.test_diffpes.test_types.test_dos.TestDensityOfStates[source]¶
Bases:
objectValidate
DensityOfStatesarray storage.The carrier must retain the shared energy and density axes together with a scalar Fermi-energy reference.
- See:
- test_stores_density_arrays() None[source]¶
Preserve equal-length energy and total-DOS arrays.
The check verifies 16 energy samples, 16 density values, and a scalar Fermi energy of
-1.5eV.Notes
The test constructs the carrier through the public factory and checks shapes and the independently specified scalar with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_dos.TestFullDensityOfStates[source]¶
Bases:
objectValidate
FullDensityOfStatesas a PyTree.Optional spin and projected fields must remain absent while required array leaves survive JAX reconstruction.
- See:
- test_pytree_round_trip() None[source]¶
Preserve required full-DOS leaves through a PyTree round trip.
The check compares a 50-point total DOS, its integral, and the scalar Fermi energy after JAX flattening and reconstruction.
Notes
The test builds a spin-up-only full carrier, uses JAX tree utilities for the round trip, and compares the restored values with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_dos.TestMakeDensityOfStates(*args, **kwargs) None[source]¶
Bases:
TestCaseValidate
make_density_of_states()under JIT.The factory must construct the same finite carrier in eager and compiled execution and reject non-increasing energy coordinates.
- test_rejects_unsorted_energy_axis() None[source]¶
Reject repeated coordinates on the DOS energy axis.
The check enforces strict monotonicity independently of the density values supplied at those coordinates.
Notes
Supplies two equal energy values and matches the traced validation diagnostic through the shared rejection helper.
- Return type:
- test_constructs_in_both_execution_modes__with_jit() None¶
Construct equal-shape DOS fields in eager and compiled execution.
The check gates the 32-point output shape and scalar Fermi-energy value in both Chex execution variants.
Notes
The test wraps the public factory with
self.variant, supplies finite arrays, and compares the resulting shape and scalar with Chex.- Return type:
- test_constructs_in_both_execution_modes__without_jit() None¶
Construct equal-shape DOS fields in eager and compiled execution.
The check gates the 32-point output shape and scalar Fermi-energy value in both Chex execution variants.
Notes
The test wraps the public factory with
self.variant, supplies finite arrays, and compares the resulting shape and scalar with Chex.- Return type:
- class tests.test_diffpes.test_types.test_dos.TestMakeFullDensityOfStates[source]¶
Bases:
objectValidate
make_full_density_of_states().The full factory must enforce the same strict energy ordering as the compact carrier while validating its integrated-DOS field.
- test_rejects_unsorted_energy_axis() None[source]¶
Reject repeated coordinates on the full-DOS energy axis.
The check verifies strict monotonicity for a complete spin-up DOS input whose density and integral otherwise have compatible shapes.
Notes
Supplies two repeated energy coordinates and matches the factory’s traced ordering diagnostic through the rejection helper.
- Return type:
Validate the carrier for the geometry of an ARPES experiment.
The tests cover the static slit field, traced validation, polarization normalization, PyTree reconstruction, and sensitivity of every numerical field.
- class tests.test_diffpes.test_types.test_experiment.TestExperimentGeometry[source]¶
Bases:
objectValidate
ExperimentGeometryas a JAX PyTree.The cases cover reconstruction and the exact division between numerical leaves and the static slit selector.
- See:
- test_preserves_the_carrier_through_a_tree_round_trip() None[source]¶
Preserve all fields through a JAX tree round trip.
The restored carrier must retain equal numerical leaves and the same static slit selector.
Notes
The test flattens one geometry with JAX and reconstructs it from the resulting leaves and tree definition.
- Return type:
- test_keeps_only_the_slit_out_of_the_numerical_leaves() None[source]¶
Keep all 11 numerical fields in the traced partition.
The static slit must not appear among the leaves that JAX transforms.
Notes
The test partitions the carrier with
equinox.is_array()and counts the numerical leaves in the dynamic result.- Return type:
- test_crosses_a_compiled_boundary_as_one_carrier() None[source]¶
Pass the complete carrier through compiled execution.
The compiled function must read traced energy and polarization fields while it preserves the static slit selection.
Notes
The test compiles a scalar reduction over two numerical fields and compares it with the same closed-form sum.
- Return type:
- class tests.test_diffpes.test_types.test_experiment.TestMakeExperimentGeometry[source]¶
Bases:
objectValidate
make_experiment_geometry().The cases cover every range check under JIT, the polarization gauge, and gradients through all numerical experiment fields.
- test_normalizes_each_nonzero_complex_polarization() None[source]¶
Normalize each accepted complex polarization to unit norm.
The norm must equal one within
1e-15for generic complex vectors.Notes
Hypothesis supplies six bounded components. The test combines them into three complex values and checks the Hermitian vector norm.
- Return type:
- test_rejects_each_invalid_scalar_under_jit(field: str, value: object, match: str) None[source]¶
Reject each scalar that violates the traced physical domain.
Eager and compiled execution must report the same field-specific validation failure.
Notes
The test changes one default input and delegates both execution modes to the shared rejection assertion.
- Return type:
- test_rejects_invalid_polarization_under_jit(polarization: Complex[Array, '3']) None[source]¶
Reject a zero or non-finite polarization under JIT.
The factory must keep both invalid branches finite before it raises the applicable runtime error.
Notes
The shared assertion calls the factory eagerly and through
equinox.filter_jit().- Return type:
- test_rejects_an_unknown_static_slit() None[source]¶
Reject a slit selector outside the two detector conventions.
The static check must fail before JAX traces numerical validation.
Notes
The test supplies
"X"and matches the slit diagnostic in eager and compiled execution.- Return type:
- test_preserves_sensitivity_of_each_scalar_field() None[source]¶
Preserve finite and nonzero gradients through every scalar field.
Automatic derivatives must agree with central differences at the smooth registered geometry.
Notes
A weighted scalar loss reads all ten scalar fields. The shared gate checks reverse mode, finite differences, and every gradient entry.
- Return type:
Validate crystal-geometry carriers and reciprocal-lattice construction.
The cases cover PyTree reconstruction, an analytic cubic reciprocal lattice, and rejection of a left-handed real-space basis.
- class tests.test_diffpes.test_types.test_geometry.TestCrystalGeometry[source]¶
Bases:
objectValidate
CrystalGeometryas a JAX PyTree.Numeric leaves and static chemical symbols must survive JAX flattening and reconstruction without changing the crystal description.
- See:
- test_pytree_round_trip() None[source]¶
Preserve array leaves and static symbols through a PyTree round trip.
The check compares a 3 Angstrom cubic lattice and one silicon symbol after JAX flattening and reconstruction.
Notes
The test constructs a one-atom geometry, flattens and unflattens it with JAX, then uses Chex for the numerical and static comparisons.
- Return type:
- class tests.test_diffpes.test_types.test_geometry.TestMakeCrystalGeometry[source]¶
Bases:
objectValidate
make_crystal_geometry().The factory must compute the analytic reciprocal basis of a cubic lattice and reject non-right-handed input cells.
- test_computes_cubic_reciprocal_lattice() None[source]¶
Match the analytic reciprocal lattice for a cubic cell.
For lattice constant 5 Angstrom, every reciprocal diagonal must equal \(2\pi/5\) inverse Angstrom within
atol=1e-10.Notes
The test constructs the cubic geometry, calculates the closed-form reciprocal matrix independently, and compares both matrices with Chex.
- Return type:
- test_rejects_left_handed_lattice() None[source]¶
Reject a finite real-space lattice with negative handedness.
The check verifies the determinant-sign convention independently of coordinate and species validation.
Notes
Supplies a diagonal lattice with determinant
-1and matches the factory’s right-handedness diagnostic.- Return type:
Validate certificate-difference carriers and their public factory.
The cases cover empty and categorized comparisons plus rejection of malformed
immutable category sequences in diffpes.types.inspection.
- class tests.test_diffpes.test_types.test_inspection.TestCertificateDiff[source]¶
Bases:
objectValidate
CertificateDiffderived properties.The carrier must distinguish an identical comparison from categorized scientific, numerical, environment, and audit differences.
- See:
- test_summarizes_categorized_differences() None[source]¶
Report nonempty comparison categories in a stable one-line form.
The check verifies both the
identicalpredicate and the exact scientific and audit category names included insummary.Notes
The test constructs a difference through the public factory, then evaluates the two derived properties without rerunning any physical model.
- Return type:
- class tests.test_diffpes.test_types.test_inspection.TestMakeCertificateDiff[source]¶
Bases:
objectValidate
make_certificate_diff().The factory must produce an identical empty comparison and reject blank or mutable category entries.
- test_builds_identical_empty_difference() None[source]¶
Represent an empty comparison as identical certificates.
The check verifies the factory defaults and the corresponding stable human-readable summary.
Notes
The test calls the factory with no categories and compares both public derived properties with their independently expected values.
- Return type:
- test_rejects_blank_category_name() None[source]¶
Reject a blank field name in any difference category.
The check exercises the immutable category validation contract with an invalid scientific field name.
Notes
Supplies a one-element tuple containing an empty string and matches the factory’s nonempty-field diagnostic.
- Return type:
Validate k-path metadata storage and mode consistency.
The cases cover immutable plotting metadata and rejection of unsupported
KPOINTS mode selectors in diffpes.types.kpath.
- class tests.test_diffpes.test_types.test_kpath.TestKPathInfo[source]¶
Bases:
objectValidate
KPathInfofield storage.The carrier must preserve line-mode labels and their integer indices.
- See:
- test_stores_line_mode_metadata() None[source]¶
Preserve line-mode indices, labels, and mode text.
The check verifies the three label positions for a 100-point path and the corresponding static symmetry labels.
Notes
The test constructs the carrier through its validated factory, checks the array shape with Chex, and compares the static metadata exactly.
- Return type:
- class tests.test_diffpes.test_types.test_kpath.TestMakeKPathInfo[source]¶
Bases:
objectValidate
make_kpath_info().The factory must reject mode strings outside the supported parser conventions.
- See:
- test_rejects_unknown_mode() None[source]¶
Reject a k-path mode outside the supported static set.
The check isolates the mode selector contract before interpretation of optional arrays for a mode.
Notes
Supplies otherwise valid minimal metadata with
mode="unknown"and matches the allowed-mode diagnostic.- Return type:
- test_rejects_incomplete_line_metadata() None[source]¶
Reject missing labels, unequal label counts, and zero segments.
The parser carrier requires complete static metadata for line mode.
Notes
The shared helper checks each independent structure error in eager and compiled execution.
- Return type:
- test_validates_each_optional_numeric_field() None[source]¶
Store finite optional arrays and reject each non-finite array.
The factory must apply its traced finite-value checks to k-points, weights, and the grid shift.
Notes
The test first constructs all optional fields. It then changes one floating field to NaN in each shared rejection check.
- Return type:
- class tests.test_diffpes.test_types.test_kpath.TestKPath[source]¶
Bases:
objectValidate
KPathas a JAX PyTree.The cases cover reconstruction and the division between traced path data and static plotting metadata.
- See:
- test_preserves_static_and_traced_fields_in_a_tree_round_trip() None[source]¶
Preserve path coordinates and plotting metadata after reconstruction.
The tree must expose only the k-points and fixed
kzas numerical leaves.Notes
The test flattens one path and restores it with the same JAX tree definition. Chex compares the complete carriers.
- Return type:
- class tests.test_diffpes.test_types.test_kpath.TestKGrid[source]¶
Bases:
objectValidate
KGridas a JAX PyTree.The cases cover the static raster shape and optional traced axis values.
- See:
- test_keeps_only_the_mesh_shape_static() None[source]¶
Keep the raster coordinates and optional values as traced leaves.
The dynamic partition must contain the k-points,
kz, and the photon-energy axis.Notes
The test partitions one two-by-two grid with
equinox.is_array()and counts its JAX leaves.- Return type:
- class tests.test_diffpes.test_types.test_kpath.TestMakeKPath[source]¶
Bases:
objectValidate
make_kpath().The cases cover static metadata checks, compiled finite-value validation, and coordinate sensitivity.
- See:
- test_rejects_nonfinite_path_data_under_jit() None[source]¶
Reject non-finite path data in eager and compiled modes.
Runtime validation must identify either the k-point or fixed
kzfield in both modes.Notes
The shared helper sends one invalid k-point path and one invalid
kzvalue through both execution modes.- Return type:
- test_rejects_invalid_static_metadata() None[source]¶
Reject unordered indices or indices outside the path.
Static validation must fail before traced coordinate validation.
Notes
The test supplies two descending indices and matches the ordering diagnostic in eager and compiled modes.
- Return type:
- test_rejects_each_other_invalid_static_setting() None[source]¶
Reject a zero segment size and inconsistent label metadata.
The factory must reject each invalid structure before it validates the traced coordinates.
Notes
The test sends three independent invalid cases through eager and compiled execution with the shared rejection helper.
- Return type:
- test_preserves_gradients_through_all_kpoint_components() None[source]¶
Preserve finite nonzero gradients through all path coordinates.
Automatic derivatives must agree with central differences for a weighted coordinate reduction.
Notes
The shared gradient gate checks reverse mode and every component of a generic two-point path.
- Return type:
- class tests.test_diffpes.test_types.test_kpath.TestMakeKGrid[source]¶
Bases:
objectValidate
make_kgrid().The cases cover raster consistency, compiled axis validation, and coordinate sensitivity.
- See:
- test_rejects_an_inconsistent_static_mesh_shape() None[source]¶
Reject a mesh shape whose product differs from the point count.
The static contract must hold before any consumer reshapes the raster.
Notes
The test gives six points and a four-element mesh shape. The shared helper checks eager and compiled rejection.
- Return type:
- test_rejects_each_other_invalid_static_shape() None[source]¶
Reject a nonpositive dimension and an axis with the wrong length.
The factory must validate both parts of the fixed raster contract.
Notes
The shared helper checks eager and compiled rejection for two independent invalid grid structures.
- Return type:
- test_rejects_invalid_traced_grid_data_under_jit() None[source]¶
Reject invalid traced grid data in eager and compiled modes.
Checks for the energy axis, k-points, and fixed
kzmust remain active after JAX compilation.Notes
The shared helper checks one invalid value in each traced grid field.
- Return type:
- test_preserves_gradients_through_all_grid_components() None[source]¶
Preserve finite nonzero gradients through all grid coordinates.
Automatic derivatives must agree with central differences for a weighted coordinate reduction.
Notes
The shared gradient gate checks reverse mode and every component of a generic two-by-two raster.
- Return type:
Validate simulation and polarization parameter carriers and factories.
The cases cover PyTree reconstruction, documented defaults, custom optical geometry, data-derived energy windows, and rejection of invalid parameters.
- class tests.test_diffpes.test_types.test_params.TestSimulationParams[source]¶
Bases:
objectValidate
SimulationParamsas a JAX PyTree.Differentiable broadening leaves and the static fidelity must survive JAX flattening and reconstruction.
- See:
- test_pytree_round_trip() None[source]¶
Preserve broadening and fidelity fields through reconstruction.
The check compares the 0.04 eV Gaussian width and 25,000-point static fidelity before and after a JAX PyTree round trip.
Notes
The test constructs default parameters, flattens and unflattens them with JAX, and compares traced and static fields independently.
- Return type:
- class tests.test_diffpes.test_types.test_params.TestPolarizationConfig[source]¶
Bases:
objectValidate
PolarizationConfigfield storage.The carrier must retain differentiable angles and its static polarization selector together.
- See:
- test_stores_linear_vertical_geometry() None[source]¶
Preserve an LVP selector and scalar incidence angles.
The check verifies the static LVP convention and the scalar shapes of the two angular fields used to define the optical geometry.
Notes
The test constructs a 45-degree LVP configuration through the public factory and checks the selector and array dimensions with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_params.TestMakeSimulationParams[source]¶
Bases:
objectValidate
make_simulation_params().The factory must provide the documented ARPES defaults, preserve custom values, and reject nonphysical windows and broadenings.
- test_constructs_documented_defaults() None[source]¶
Construct the documented energy window and broadening defaults.
The check verifies
[-3, 1]eV, 25,000 samples, and Gaussian and Lorentzian widths of 0.04 eV and 0.1 eV.Notes
The test calls the factory without arguments and compares all defining default fields with independent constants using Chex.
- Return type:
- test_preserves_custom_temperature() None[source]¶
Preserve an explicit 300 K simulation temperature.
The check verifies user values override defaults after conversion to a scalar float64 JAX array.
Notes
The test constructs a custom parameter set and compares the stored temperature with an independent 300 K scalar using Chex.
- Return type:
- test_rejects_nonphysical_parameters() None[source]¶
Reject negative broadening and a reversed energy window.
The check covers both independent physical validation boundaries of the base simulation-parameter factory.
Notes
The test uses the eager-and-JIT rejection helper with a negative Gaussian width and then with
energy_mingreater thanenergy_max.- Return type:
- class tests.test_diffpes.test_types.test_params.TestMakePolarizationConfig[source]¶
Bases:
objectValidate
make_polarization_config().The factory must supply an unpolarized default and reject selectors outside the supported static convention set.
- test_constructs_unpolarized_default() None[source]¶
Construct an unpolarized configuration with scalar angles.
The check verifies the default selector and scalar angle shapes without assuming a downstream polarization-vector implementation.
Notes
The test calls the factory without arguments and checks the static selector and traced array shapes with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_params.TestMakeExpandedSimulationParams[source]¶
Bases:
objectValidate
make_expanded_simulation_params().The factory must derive its energy window from band extrema and symmetric padding. It must retain differentiable dependence on these inputs.
- test_derives_energy_window_from_bands() None[source]¶
Expand band extrema by the requested energy padding.
For bands spanning
[-2, 3]eV and padding 0.5 eV, the expected simulation window is[-2.5, 3.5]eV.Notes
Supplies a two-by-two band array, constructs the expanded parameters, and compares both derived bounds with the analytic extrema.
- Return type:
Validate provenance and information-flow carriers and factories.
The cases cover immutable semantic states, graph-boundary invariants, and validity consistency without invoking the higher-level propagation engine.
- class tests.test_diffpes.test_types.test_provenance.TestInformationState[source]¶
Bases:
objectValidate
InformationStatestorage.The carrier must keep available semantics separate from destroyed information and invalidated claims.
- See:
- test_separates_semantic_categories() None[source]¶
Preserve active, destroyed, and invalidated semantic categories.
The check compares each immutable category against independently supplied labels for one artifact node.
Notes
The test constructs the state through its public factory and reads every static information-flow field directly from the resulting carrier.
- Return type:
- class tests.test_diffpes.test_types.test_provenance.TestProvenanceGraph[source]¶
Bases:
objectValidate
ProvenanceGraphstorage.The carrier must retain deterministic root semantics, propagated states, topological order, and graph identity.
- See:
- test_stores_empty_valid_graph() None[source]¶
Represent a valid external root with no transformation edges.
The check verifies the minimal graph boundary independently of graph propagation behavior owned by
diffpes.certify.Notes
The test builds one root state and an edge-free graph, then compares root, order, state, and checksum fields with their explicit inputs.
- Return type:
- class tests.test_diffpes.test_types.test_provenance.TestProvenanceReport[source]¶
Bases:
objectValidate
ProvenanceReportstorage.The carrier must retain graph endpoints and validation status without introducing differentiable leaves.
- See:
- test_stores_valid_graph_summary() None[source]¶
Preserve graph roots, terminals, order, and checksum.
The check verifies the complete successful-report boundary for a single-root, single-terminal graph.
Notes
The test constructs a valid report through the public factory and compares its static endpoint fields with independently specified tuples.
- Return type:
- class tests.test_diffpes.test_types.test_provenance.TestMakeInformationState[source]¶
Bases:
objectValidate
make_information_state().The factory must reject blank node identities and duplicate semantic labels before constructing an immutable state.
- test_rejects_invalid_state(node_id: str, active_semantics: tuple[str, ...], message: str) None[source]¶
Reject an invalid node identity or duplicated semantic label.
The parameter table covers the two independent validation boundaries of the semantic-state factory.
Notes
The test calls the factory for each malformed static input and matches the diagnostic emitted by the corresponding validation branch.
- Return type:
- class tests.test_diffpes.test_types.test_provenance.TestMakeProvenanceGraph[source]¶
Bases:
objectValidate
make_provenance_graph().The factory must require exactly one initial-semantic entry for every external root and unique propagated state identities.
- test_rejects_incomplete_root_semantics() None[source]¶
Reject a graph whose initial semantics omit an external root.
The check isolates the root-coverage invariant at the carrier factory rather than relying on the higher-level graph builder.
Notes
Supplies one external input and no initial-semantic pairs, then matches the explicit root-coverage diagnostic.
- Return type:
- class tests.test_diffpes.test_types.test_provenance.TestMakeProvenanceReport[source]¶
Bases:
objectValidate
make_provenance_report().The factory must keep the report validity flag equivalent to an empty validation-error sequence.
- test_rejects_inconsistent_validity() None[source]¶
Reject a successful provenance report containing errors.
The check verifies the Boolean consistency invariant independently of graph construction and semantic propagation.
Notes
Supplies
valid=Truewith one error and matches the consistency diagnostic raised before construction.- Return type:
Validate orbital-basis and Slater-parameter carriers and factories.
The cases cover static PyTree metadata, differentiable radial parameters, default labels and coefficients, and quantum-number and shape validation.
- class tests.test_diffpes.test_types.test_radial_params.TestOrbitalBasis[source]¶
Bases:
objectValidate
OrbitalBasisas static PyTree data.Quantum numbers and labels must survive JAX reconstruction without becoming differentiable leaves.
- See:
- test_pytree_round_trip() None[source]¶
Preserve three orbital labels and quantum-number tuples.
The check compares
s,p, anddmetadata before and after a JAX PyTree round trip.Notes
The test constructs the basis with explicit tuples, flattens and unflattens it, and compares every static field exactly.
- Return type:
- class tests.test_diffpes.test_types.test_radial_params.TestSlaterParams[source]¶
Bases:
objectValidate
SlaterParamsgradient behavior.Slater exponents and coefficients must remain differentiable JAX leaves while their orbital basis remains static structure.
- See:
- test_zeta_gradient() None[source]¶
Differentiate a quadratic loss through the Slater exponent.
At exponent 2 inverse Angstrom, the derivative of \(\zeta^2\) must equal 4 within the default Chex numerical tolerance.
Notes
The test constructs one radial parameter carrier, differentiates an independent quadratic loss with JAX, and compares its
zetagradient with 4.- Return type:
- class tests.test_diffpes.test_types.test_radial_params.TestMakeOrbitalBasis[source]¶
Bases:
objectValidate
make_orbital_basis().The factory must generate stable labels and reject inconsistent tuple lengths or quantum numbers outside their physical ranges.
- See:
- test_generates_default_labels() None[source]¶
Generate zero-indexed labels for unlabeled orbitals.
The check verifies the independent naming convention
orb_0andorb_1for a two-orbital basis.Notes
The test constructs a valid two-orbital basis without labels and compares the immutable generated tuple exactly.
- Return type:
- test_rejects_mismatched_lengths() None[source]¶
Reject unequal quantum-number and label tuple lengths.
The check covers both the three required quantum-number axes and the optional label axis.
Notes
The test calls the factory once with mismatched quantum numbers and once with an extra label, matching the shared static diagnostic.
- Return type:
- test_rejects_invalid_quantum_numbers() None[source]¶
Reject principal quantum numbers below one.
The check isolates the lower bound on
nfrom the angular and magnetic quantum-number constraints.Notes
Supplies a length-consistent one-orbital tuple with
n=0and matches the factory’s principal-quantum-number diagnostic.- Return type:
- class tests.test_diffpes.test_types.test_radial_params.TestMakeSlaterParams[source]¶
Bases:
objectValidate
make_slater_params().The factory must provide unit default coefficients, normalize dtype, and reject incompatible or nonpositive radial parameters.
- See:
- test_supplies_unit_coefficients() None[source]¶
Create one unit coefficient per orbital when omitted.
The check expects a
2 x 1float64 matrix of ones for two Slater exponents.Notes
The test constructs a two-orbital basis and radial carrier without coefficients, then compares shape, dtype, and values with Chex.
- Return type:
- test_casts_explicit_coefficients_to_float64() None[source]¶
Promote explicit float32 coefficients to float64.
The check verifies the project-wide precision policy for a two-orbital, two-term Slater expansion.
Notes
Supplies a float32 coefficient matrix and checks its stored shape and dtype after factory normalization.
- Return type:
- test_rejects_invalid_radial_arrays() None[source]¶
Reject nonpositive exponents and coefficient-axis mismatches.
The check covers the physical lower bound on
zetaand the static first-axis agreement with the orbital basis.Notes
The test uses the eager-and-JIT rejection helper with zero exponent and then a two-row coefficient matrix for a one-orbital basis.
- Return type:
Validate self-energy configuration carriers and factory modes.
The cases cover differentiable leaf reconstruction, default and polynomial configuration, and the static and traced validation rules for tabulated data.
- class tests.test_diffpes.test_types.test_self_energy.TestSelfEnergyConfig[source]¶
Bases:
objectValidate
SelfEnergyConfigas a JAX PyTree.The static mode and differentiable coefficient leaves must survive JAX flattening and reconstruction together.
- See:
- test_pytree_round_trip() None[source]¶
Preserve self-energy mode and coefficients through reconstruction.
The check compares a constant 0.2 eV broadening before and after a JAX PyTree round trip.
Notes
The test constructs the carrier through its factory, flattens and unflattens it with JAX, then compares the static and array fields independently.
- Return type:
- class tests.test_diffpes.test_types.test_self_energy.TestMakeSelfEnergyConfig[source]¶
Bases:
objectValidate
make_self_energy_config().The factory must construct supported constant and polynomial modes while rejecting invalid selectors and malformed tabulated coordinates.
- test_constructs_constant_default() None[source]¶
Construct the documented constant 0.1 eV default broadening.
The check verifies the static mode, one-element coefficient shape, and scalar value to
pytest.approxprecision.Notes
The test calls the factory without arguments and compares every field defining the default constant configuration.
- Return type:
- test_constructs_polynomial_mode() None[source]¶
Preserve two explicit polynomial coefficients.
The check verifies the static polynomial selector and coefficients
[0.01, 0.1]used for energy-dependent broadening.Notes
The test constructs the polynomial configuration with a JAX array and compares the stored mode and coefficients directly.
- Return type:
- test_rejects_missing_tabulated_nodes() None[source]¶
Reject tabulated broadening without interpolation nodes.
The check enforces the required coordinate set for a tabulated self-energy configuration.
Notes
The test selects tabulated mode without
energy_nodesand matches the static factory diagnostic.- Return type:
- test_rejects_invalid_mode() None[source]¶
Reject a self-energy mode outside the supported static set.
The check isolates selector validation from all numerical parameter checks.
Notes
Supplies
mode="invalid"and matches the factory’s allowed-mode diagnostic.- Return type:
- test_rejects_unsorted_or_mismatched_nodes() None[source]¶
Reject repeated nodes and unequal node and coefficient lengths.
The check covers both tabulated-axis invariants with otherwise finite numerical inputs.
Notes
The test uses the shared eager-and-JIT rejection helper for repeated nodes and then for a three-node, two-coefficient length mismatch.
- Return type:
Validate tight-binding and diagonalized-band carriers and factories.
The cases cover PyTree reconstruction, differentiable hopping parameters, eigensystem validation, connectivity bounds, and two analytic model presets.
- class tests.test_diffpes.test_types.test_tb_model.TestDiagonalizedBands[source]¶
Bases:
objectValidate
DiagonalizedBandsas a JAX PyTree.Real eigenvalues and complex eigenvectors must survive JAX reconstruction without changing their k-point and orbital axes.
- See:
- test_pytree_round_trip() None[source]¶
Preserve a two-point eigensystem through JAX reconstruction.
The check compares a
2 x 2energy matrix and its complex identity eigenvectors after a PyTree round trip.Notes
The test constructs the carrier through its factory, flattens and unflattens it with JAX, and compares both numerical leaves with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_tb_model.TestTBModel[source]¶
Bases:
objectValidate
TBModelgradient behavior.Hopping amplitudes must remain differentiable leaves while connectivity and the orbital basis remain static model structure.
- See:
- test_hopping_gradient() None[source]¶
Differentiate a quadratic loss through hopping amplitudes.
At hopping value 1 eV, the derivative of \(t^2\) must equal 2 within the default Chex numerical tolerance.
Notes
The test constructs a one-hop model, differentiates an independently defined quadratic loss with JAX, and compares the hopping leaf with 2.
- Return type:
- class tests.test_diffpes.test_types.test_tb_model.TestMakeDiagonalizedBands[source]¶
Bases:
objectValidate
make_diagonalized_bands().The factory must preserve compatible eigensystem dimensions and reject non-finite eigenvectors or mismatched k-point axes.
- test_constructs_expected_shapes() None[source]¶
Construct a five-point, three-band, four-orbital eigensystem.
The check gates the exact eigenvalue and eigenvector dimensions after dtype normalization by the factory.
Notes
Supplies finite zero energies and unit complex vectors, then checks both carrier shapes with Chex.
- Return type:
- test_rejects_invalid_eigensystems() None[source]¶
Reject non-finite vectors and inconsistent k-point dimensions.
The check covers the numerical finiteness guard and the static leading dimension contract between eigenvalues and eigenvectors.
Notes
The test uses the eager-and-JIT rejection helper first with a NaN vector and then with unequal one- and two-point eigensystem arrays.
- Return type:
- class tests.test_diffpes.test_types.test_tb_model.TestMakeTBModel[source]¶
Bases:
objectValidate
make_tb_model().The factory must preserve hopping arrays and reject connectivity that references an orbital outside the declared basis.
- See:
- test_constructs_hopping_array() None[source]¶
Store two nearest-neighbor hopping amplitudes.
The check verifies the one-dimensional hopping shape for forward and backward translations of a single orbital.
Notes
The test constructs a validated model with two static connectivity entries and checks the differentiable hopping leaf shape with Chex.
- Return type:
- test_rejects_out_of_range_orbital_index() None[source]¶
Reject connectivity referencing an absent second orbital.
The check isolates the static orbital-index bound for a model declaring exactly one orbital.
Notes
Supplies connectivity ending at index one and matches the factory’s allowed-index diagnostic.
- Return type:
- class tests.test_diffpes.test_types.test_tb_model.TestMake1dChainModel[source]¶
Bases:
objectValidate
make_1d_chain_model().The preset must construct one orbital with two translated nearest-neighbor hopping entries and preserve the supplied amplitude.
- test_constructs_chain_connectivity() None[source]¶
Construct the two-hop one-orbital chain preset.
The check verifies two amplitudes of
-1.5eV and the declared single-orbital model size.Notes
The test calls the convenience factory with an explicit hopping value and compares the carrier’s static size and numerical hopping leaf.
- Return type:
- class tests.test_diffpes.test_types.test_tb_model.TestMakeGrapheneModel[source]¶
Bases:
objectValidate
make_graphene_model().The preset must construct the two-sublattice honeycomb model with the expected number of nearest-neighbor hopping entries.
- test_constructs_two_orbital_model() None[source]¶
Construct the two-orbital graphene preset.
The check verifies the A/B orbital count and that every generated hopping amplitude equals the supplied
-2.7eV value.Notes
The test calls the convenience factory, checks its static orbital count, and compares all numerical hopping leaves with an independent constant.
- Return type:
Validate scalar and spin-orbit volumetric carriers and factories.
The cases cover PyTree reconstruction, default atom counts, and consistency between static grid metadata and scalar or vector-valued volumetric arrays.
- class tests.test_diffpes.test_types.test_volumetric.TestVolumetricData[source]¶
Bases:
objectValidate
VolumetricDataas a JAX PyTree.Charge-density leaves and static grid and species metadata must survive flattening and reconstruction together.
- See:
- test_pytree_round_trip() None[source]¶
Preserve charge values and static metadata through reconstruction.
The check compares a
4 x 4 x 4unit charge grid, its grid shape, and two species labels after a JAX PyTree round trip.Notes
The test constructs the scalar carrier through its factory, uses JAX tree utilities for reconstruction, and compares numerical and static fields.
- Return type:
- class tests.test_diffpes.test_types.test_volumetric.TestSOCVolumetricData[source]¶
Bases:
objectValidate
SOCVolumetricDataas a JAX PyTree.Scalar and vector magnetization leaves must remain associated with their common spin-orbit grid through JAX transformations.
- See:
- test_pytree_round_trip() None[source]¶
Preserve charge and magnetization grids through reconstruction.
The check uses a
2 x 2 x 2scalar grid and a final vector axis of length three for the spin-orbit magnetization components.Notes
The test constructs the SOC carrier, applies a JAX flatten and unflatten round trip, and compares all numerical grid leaves with Chex.
- Return type:
- class tests.test_diffpes.test_types.test_volumetric.TestMakeVolumetricData[source]¶
Bases:
objectValidate
make_volumetric_data().The scalar factory must supply an empty integer atom-count array and reject charge grids inconsistent with static shape metadata.
- test_supplies_empty_atom_counts() None[source]¶
Create a zero-length int32 atom-count array when omitted.
The check verifies both dtype and shape of the stable array sentinel used instead of
None.Notes
The test constructs a one-species volume without
atom_countsand uses Chex to compare the resulting array shape and dtype.- Return type:
- test_rejects_grid_shape_mismatch() None[source]¶
Reject charge data inconsistent with the declared grid shape.
The check verifies that a
2 x 2 x 2charge array cannot have a1 x 1 x 1grid label.Notes
Supplies otherwise compatible geometry and matches the factory’s static charge-shape diagnostic.
- Return type:
- class tests.test_diffpes.test_types.test_volumetric.TestMakeSOCVolumetricData[source]¶
Bases:
objectValidate
make_soc_volumetric_data().The SOC factory must provide the same atom-count sentinel. It must require vector magnetization dimensions that match the static grid.
- test_supplies_empty_atom_counts() None[source]¶
Create a zero-length int32 atom-count array when omitted.
The check verifies the stable array sentinel for a minimal SOC volume with all four required grid blocks.
Notes
The test constructs a one-point SOC volume without
atom_countsand checks the resulting array dtype and shape.- Return type:
- test_rejects_vector_grid_shape_mismatch() None[source]¶
Reject vector magnetization with incompatible spatial dimensions.
The check verifies all three spatial dimensions against the declared grid independently of the final three-component axis.
Notes
Supplies a vector grid with a doubled first dimension and matches the factory’s static spatial-shape diagnostic.
- Return type: