torax.transport_model.tests package
Submodules
torax.transport_model.tests.bohm_gyrobohm_test module
- class torax.transport_model.tests.bohm_gyrobohm_test.BohmGyroBohmTest(*args, **kwargs)[source]
Bases:
TestCase- test_coeff_multiplier_feature()[source]
Test that modifying coefficients or multipliers equivalently affects outputs.
Verifies that if the product of coefficient and multiplier is held constant— either by changing the coefficient with multipliers left at 1 or by leaving the coefficients at default (1) and scaling the multipliers—the computed transport coefficients (chi_face_ion and chi_face_el) remain identical.
torax.transport_model.tests.pydantic_model_test module
torax.transport_model.tests.qlknn_model_wrapper_test module
- class torax.transport_model.tests.qlknn_model_wrapper_test.QlknnModelWrapperTest(*args, **kwargs)[source]
Bases:
TestCase- test_load_model_from_name(mock_load_model_from_name)[source]
Tests that the model is loaded from the name.
torax.transport_model.tests.qlknn_transport_model_test module
- class torax.transport_model.tests.qlknn_transport_model_test.QlknnTransportModelTest(*args, **kwargs)[source]
Bases:
TestCase- test_filter_model_output_etg({'etg': False})
Tests that the model output is properly filtered.
- test_filter_model_output_etg_and_itg({'etg': False, 'itg': False})
Tests that the model output is properly filtered.
- test_filter_model_output_itg({'itg': False})
Tests that the model output is properly filtered.
- test_filter_model_output_tem({'tem': False})
Tests that the model output is properly filtered.
- test_get_model_from_name_qlknn10d_fails(mock_qlknn_qlknn10d)[source]
Tests that the model is loaded from the path.
- test_get_model_from_path_qlknn10d(mock_qlknn_qlknn10d)[source]
Tests that the model is loaded from the path.
- test_get_model_with_name_only(mock_qlknn_model_wrapper)[source]
Tests that the model is loaded from the path.
torax.transport_model.tests.qualikiz_based_transport_model_test module
- class torax.transport_model.tests.qualikiz_based_transport_model_test.FakeQualikizBasedTransportModel[source]
Bases:
QualikizBasedTransportModelFake QualikizBasedTransportModel for testing purposes.
- class torax.transport_model.tests.qualikiz_based_transport_model_test.QualikizBasedTransportModelConfig(**data)[source]
Bases:
TransportBaseModel for the Qualikiz-based transport model.
- transport_model
The transport model to use. Hardcoded to ‘qualikiz’.
- coll_mult
Collisionality multiplier.
- avoid_big_negative_s
Ensure that smag - alpha > -0.2 always, to compensate for no slab modes.
- smag_alpha_correction
Reduce magnetic shear by 0.5*alpha to capture main impact of alpha.
- q_sawtooth_proxy
If q < 1, modify input q and smag as if q~1 as if there are sawteeth.
- DVeff
Effective D / effective V approach for particle transport.
- Parameters:
data (
Any)
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
torax.transport_model.tests.qualikiz_transport_model_test module
torax.transport_model.tests.quasilinear_transport_model_test module
- class torax.transport_model.tests.quasilinear_transport_model_test.FakeQuasilinearTransportModel[source]
Bases:
QuasilinearTransportModelFake QuasilinearTransportModel for testing purposes.
- class torax.transport_model.tests.quasilinear_transport_model_test.QuasilinearTransportConfig(**data)[source]
Bases:
TransportBaseQuasilinearTransportConfig for testing purposes.
- Parameters:
data (
Any)
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class torax.transport_model.tests.quasilinear_transport_model_test.QuasilinearTransportModelTest(*args, **kwargs)[source]
Bases:
TestCase- test_calculate_normalized_logarithmic_gradient()[source]
Tests that calculate_normalized_logarithmic_gradient is calculated correctly.
- test_quasilinear_transport_model_dveff_DVeff_False(DVeff=False, An_min=0.05, expected_zero_v_face_el=False, expected_zero_d_face_el=False)
Tests that the DVeff approach options behaves as expected.
- test_quasilinear_transport_model_dveff_DVeff_True_An_min_greater_than_Ane(DVeff=True, An_min=2.0, expected_zero_v_face_el=False, expected_zero_d_face_el=True)
Tests that the DVeff approach options behaves as expected.
- test_quasilinear_transport_model_dveff_DVeff_True_An_min_less_than_Ane(DVeff=True, An_min=0.05, expected_zero_v_face_el=True, expected_zero_d_face_el=False)
Tests that the DVeff approach options behaves as expected.
torax.transport_model.tests.transport_model_test module
- class torax.transport_model.tests.transport_model_test.FakeTransportConfig(**data)[source]
Bases:
TransportBaseFake transport config for a model that always returns zeros.
- Parameters:
data (
Any)
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class torax.transport_model.tests.transport_model_test.FakeTransportModel[source]
Bases:
TransportModelFake TransportModel for testing purposes.
Module contents
Transport model tests.