yasfpy.export ============= .. py:module:: yasfpy.export .. autoapi-nested-parse:: Export container models. This module defines lightweight Pydantic models used to serialize simulation inputs/outputs (particles, wavelengths, angular phase functions) to common file formats. .. rubric:: Notes The models are intentionally permissive (``arbitrary_types_allowed=True``) and are primarily used as an interchange format rather than as strict validation of scientific inputs. Classes ------- .. autoapisummary:: yasfpy.export.Particles yasfpy.export.Wavelength yasfpy.export.Angle yasfpy.export.Spatial yasfpy.export.Export Module Contents --------------- .. py:class:: Particles Particle geometry and material inputs for export. :ivar position: Particle center positions ``(N, 3)``. :ivar radii: Particle radii (length ``N``). :ivar refractive_index: Per-particle complex refractive index. For multi-wavelength simulations, each particle may store a list of values. :ivar radius_of_gyration: Radius of gyration of the particle ensemble. :ivar metadata: Optional free-form metadata. .. py:attribute:: position :type: list[list[float]] :value: None .. py:attribute:: radii :type: list[float] :value: None .. py:attribute:: refractive_index :type: list[list[complex]] :value: None .. py:attribute:: radius_of_gyration :type: float :value: None .. py:attribute:: metadata :type: dict[str, Any] :value: None .. py:class:: Wavelength Wavelength-dependent scalar outputs for export. .. py:attribute:: value :type: list[float] :value: None .. py:attribute:: geometric_cross_section :type: float :value: None .. py:attribute:: extinction_cross_section :type: list[float] :value: None .. py:attribute:: scattering_cross_section :type: list[float] :value: None .. py:attribute:: extinction_efficiency :type: list[float] :value: None .. py:attribute:: scattering_efficiency :type: list[float] :value: None .. py:attribute:: single_scattering_albedo :type: list[float] :value: None .. py:attribute:: medium_refractive_index :type: list[float] | list[complex] :value: None .. py:class:: Angle Angle-resolved outputs for export. .. py:attribute:: theta :type: list[float] :value: None .. py:attribute:: phase_function :type: list[list[float]] :value: None .. py:attribute:: degree_of_linear_polarization :type: list[list[float]] :value: None .. py:attribute:: degree_of_linear_polarization_q :type: list[list[float]] :value: None .. py:attribute:: degree_of_linear_polarization_u :type: list[list[float]] :value: None .. py:attribute:: degree_of_circular_polarization :type: list[list[float]] :value: None .. py:attribute:: depolarization_ratio :type: list[list[float]] :value: None .. py:attribute:: anisotropy_parameter :type: list[list[float]] :value: None .. py:class:: Spatial Spatially resolved outputs for export. .. py:attribute:: polar :type: list[float] :value: None .. py:attribute:: azimuthal :type: list[float] :value: None .. py:attribute:: phase_function :type: list[list[list[float]]] :value: None .. py:attribute:: degree_of_linear_polarization :type: list[list[list[float]]] :value: None .. py:attribute:: degree_of_linear_polarization_q :type: list[list[list[float]]] :value: None .. py:attribute:: degree_of_linear_polarization_u :type: list[list[list[float]]] :value: None .. py:attribute:: degree_of_circular_polarization :type: list[list[list[float]]] :value: None .. py:attribute:: depolarization_ratio :type: list[list[list[float]]] :value: None .. py:attribute:: anisotropy_parameter :type: list[list[list[float]]] :value: None .. py:class:: Export(/, **data) Bases: :py:obj:`pydantic.BaseModel` Serializable export record. This is a convenience wrapper that collects all exportable sections. .. rubric:: Notes The section fields accept either validated dataclass instances or raw Python mappings; :meth:`model_post_init` coerces mappings to the corresponding model. .. py:attribute:: source :type: str :value: None .. py:attribute:: scale :type: float :value: None .. py:attribute:: particles :type: Particles | dict[str, Any] :value: None .. py:attribute:: wavelength :type: Wavelength | dict[str, Any] :value: None .. py:attribute:: angle :type: Angle | dict[str, Any] :value: None .. py:attribute:: spatial :type: Spatial | dict[str, Any] :value: None .. py:attribute:: model_config :type: pydantic.ConfigDict Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:method:: model_post_init(__context) Coerce mapping sections to their dataclass models. .. py:method:: save(filename) Write the export record to disk. :param filename: Output file path. The extension determines the serialization format (``.json``, ``.yml``/``.yaml``, ``.pkl``, ``.bz2``, ``.mat``).