musica 0.12.2__cp39-cp39-macosx_15_0_arm64.whl → 0.13.0__cp39-cp39-macosx_15_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of musica might be problematic. Click here for more details.

Files changed (66) hide show
  1. musica/.dylibs/libgcc_s.1.1.dylib +0 -0
  2. musica/.dylibs/libgfortran.5.dylib +0 -0
  3. musica/.dylibs/libquadmath.0.dylib +0 -0
  4. musica/CMakeLists.txt +4 -0
  5. musica/_musica.cpython-39-darwin.so +0 -0
  6. musica/_version.py +1 -1
  7. musica/binding_common.cpp +6 -9
  8. musica/binding_common.hpp +17 -1
  9. musica/grid.cpp +206 -0
  10. musica/grid.py +98 -0
  11. musica/grid_map.cpp +117 -0
  12. musica/grid_map.py +167 -0
  13. musica/mechanism_configuration/__init__.py +18 -1
  14. musica/mechanism_configuration/ancillary.py +6 -0
  15. musica/mechanism_configuration/arrhenius.py +111 -269
  16. musica/mechanism_configuration/branched.py +116 -275
  17. musica/mechanism_configuration/emission.py +63 -52
  18. musica/mechanism_configuration/first_order_loss.py +73 -157
  19. musica/mechanism_configuration/mechanism.py +93 -0
  20. musica/mechanism_configuration/phase.py +44 -33
  21. musica/mechanism_configuration/phase_species.py +58 -0
  22. musica/mechanism_configuration/photolysis.py +77 -67
  23. musica/mechanism_configuration/reaction_component.py +54 -0
  24. musica/mechanism_configuration/reactions.py +17 -58
  25. musica/mechanism_configuration/species.py +45 -71
  26. musica/mechanism_configuration/surface.py +78 -74
  27. musica/mechanism_configuration/taylor_series.py +136 -0
  28. musica/mechanism_configuration/ternary_chemical_activation.py +138 -330
  29. musica/mechanism_configuration/troe.py +138 -330
  30. musica/mechanism_configuration/tunneling.py +105 -229
  31. musica/mechanism_configuration/user_defined.py +79 -68
  32. musica/mechanism_configuration.cpp +54 -162
  33. musica/musica.cpp +2 -5
  34. musica/profile.cpp +294 -0
  35. musica/profile.py +93 -0
  36. musica/profile_map.cpp +117 -0
  37. musica/profile_map.py +167 -0
  38. musica/test/examples/v1/full_configuration/full_configuration.json +91 -233
  39. musica/test/examples/v1/full_configuration/full_configuration.yaml +191 -290
  40. musica/test/integration/test_chapman.py +2 -2
  41. musica/test/integration/test_tuvx.py +72 -15
  42. musica/test/unit/test_grid.py +137 -0
  43. musica/test/unit/test_grid_map.py +126 -0
  44. musica/test/unit/test_parser.py +10 -10
  45. musica/test/unit/test_profile.py +169 -0
  46. musica/test/unit/test_profile_map.py +137 -0
  47. musica/test/unit/test_serializer.py +17 -16
  48. musica/test/unit/test_state.py +17 -4
  49. musica/test/unit/test_util_full_mechanism.py +78 -298
  50. musica/tuvx.cpp +94 -15
  51. musica/tuvx.py +92 -22
  52. musica/types.py +13 -5
  53. {musica-0.12.2.dist-info → musica-0.13.0.dist-info}/METADATA +14 -14
  54. musica-0.13.0.dist-info/RECORD +90 -0
  55. musica/mechanism_configuration/aqueous_equilibrium.py +0 -274
  56. musica/mechanism_configuration/condensed_phase_arrhenius.py +0 -309
  57. musica/mechanism_configuration/condensed_phase_photolysis.py +0 -88
  58. musica/mechanism_configuration/henrys_law.py +0 -44
  59. musica/mechanism_configuration/mechanism_configuration.py +0 -234
  60. musica/mechanism_configuration/simpol_phase_transfer.py +0 -217
  61. musica/mechanism_configuration/wet_deposition.py +0 -52
  62. musica-0.12.2.dist-info/RECORD +0 -80
  63. {musica-0.12.2.dist-info → musica-0.13.0.dist-info}/WHEEL +0 -0
  64. {musica-0.12.2.dist-info → musica-0.13.0.dist-info}/entry_points.txt +0 -0
  65. {musica-0.12.2.dist-info → musica-0.13.0.dist-info}/licenses/AUTHORS.md +0 -0
  66. {musica-0.12.2.dist-info → musica-0.13.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,44 +0,0 @@
1
- from typing import Optional, Any, Dict, Union, Tuple
2
- from .. import backend
3
- from .phase import Phase
4
- from .species import Species
5
- from .utils import _add_other_properties
6
-
7
- _backend = backend.get_backend()
8
- _HenrysLaw = _backend._mechanism_configuration._HenrysLaw
9
- _ReactionComponent = _backend._mechanism_configuration._ReactionComponent
10
-
11
-
12
- class HenrysLaw(_HenrysLaw):
13
- """
14
- A class representing a Henry's law reaction rate constant.
15
-
16
- Attributes:
17
- name (str): The name of the Henry's law reaction rate constant.
18
- other_properties (Dict[str, Any]): A dictionary of other properties of the Henry's law reaction rate constant.
19
- """
20
-
21
- def __init__(
22
- self,
23
- name: Optional[str] = None,
24
- other_properties: Optional[Dict[str, Any]] = None,
25
- ):
26
- """
27
- Initializes the HenrysLaw object with the given parameters.
28
-
29
- Args:
30
- name (str): The name of the Henry's law reaction rate constant.
31
- other_properties (Dict[str, Any]): A dictionary of other properties of the Henry's law reaction rate constant.
32
- """
33
- super().__init__()
34
- self.name = name if name is not None else self.name
35
- self.other_properties = other_properties if other_properties is not None else self.other_properties
36
-
37
- @staticmethod
38
- def serialize(instance) -> Dict:
39
- serialize_dict = {
40
- "type": "HL_PHASE_TRANSFER",
41
- "name": instance.name,
42
- }
43
- _add_other_properties(serialize_dict, instance.other_properties)
44
- return serialize_dict
@@ -1,234 +0,0 @@
1
- # Copyright (C) 2025 University Corporation for Atmospheric Research
2
- # SPDX-License-Identifier: Apache-2.0
3
- #
4
- # This file is part of the musica Python package.
5
- # For more information, see the LICENSE file in the top-level directory of this distribution.
6
- from .reactions import Reactions, ReactionType
7
- from .user_defined import UserDefined, _UserDefined
8
- from .simpol_phase_transfer import SimpolPhaseTransfer, _SimpolPhaseTransfer
9
- from .henrys_law import HenrysLaw, _HenrysLaw
10
- from .wet_deposition import WetDeposition, _WetDeposition
11
- from .aqueous_equilibrium import AqueousEquilibrium, _AqueousEquilibrium
12
- from .first_order_loss import FirstOrderLoss, _FirstOrderLoss
13
- from .emission import Emission, _Emission
14
- from .condensed_phase_photolysis import CondensedPhasePhotolysis, _CondensedPhasePhotolysis
15
- from .photolysis import Photolysis, _Photolysis
16
- from .surface import Surface, _Surface
17
- from .tunneling import Tunneling, _Tunneling
18
- from .branched import Branched, _Branched
19
- from .troe import Troe, _Troe
20
- from .ternary_chemical_activation import TernaryChemicalActivation, _TernaryChemicalActivation
21
- from .condensed_phase_arrhenius import CondensedPhaseArrhenius, _CondensedPhaseArrhenius
22
- from .arrhenius import Arrhenius, _Arrhenius
23
- from .phase import Phase
24
- from .species import Species
25
- import os
26
- import json
27
- import yaml
28
- from typing import Optional, Any, Dict, List
29
- from .. import backend
30
-
31
- _backend = backend.get_backend()
32
- _mc = _backend._mechanism_configuration
33
- _Mechanism = _mc._Mechanism
34
- _Version = _mc._Version
35
- _Parser = _mc._Parser
36
-
37
-
38
- class Version(_Version):
39
- """
40
- A class representing the version of the mechanism.
41
- """
42
-
43
-
44
- class Mechanism(_Mechanism):
45
- """
46
- A class representing a chemical mechanism.
47
-
48
- Attributes:
49
- name (str): The name of the mechanism.
50
- reactions (List[Reaction]): A list of reactions in the mechanism.
51
- species (List[Species]): A list of species in the mechanism.
52
- phases (List[Phase]): A list of phases in the mechanism.
53
- version (Version): The version of the mechanism.
54
- """
55
-
56
- def __init__(
57
- self,
58
- name: Optional[str] = None,
59
- reactions: Optional[List[Any]] = None,
60
- species: Optional[List[Species]] = None,
61
- phases: Optional[List[Phase]] = None,
62
- version: Optional[Version] = None,
63
- ):
64
- """
65
- Initializes the Mechanism object with the given parameters.
66
-
67
- Args:
68
- name (str): The name of the mechanism.
69
- reactions (List[]): A list of reactions in the mechanism.
70
- species (List[Species]): A list of species in the mechanism.
71
- phases (List[Phase]): A list of phases in the mechanism.
72
- version (Version): The version of the mechanism.
73
- """
74
- super().__init__()
75
- self.name = name
76
- self.species = species if species is not None else []
77
- self.phases = phases if phases is not None else []
78
- self.reactions = Reactions(
79
- reactions=reactions if reactions is not None else [])
80
- self.version = version if version is not None else Version()
81
-
82
- def to_dict(self) -> Dict:
83
- species_list = []
84
- for species in self.species:
85
- species_list.append(Species.serialize(species))
86
-
87
- phases_list = []
88
- for phase in self.phases:
89
- phases_list.append(Phase.serialize(phase))
90
-
91
- reactions_list = []
92
- for reaction in self.reactions:
93
- if isinstance(reaction, _Arrhenius):
94
- # Handle C++ _Arrhenius objects with static serialize call
95
- reactions_list.append(Arrhenius.serialize_static(reaction))
96
- elif isinstance(reaction, Arrhenius):
97
- # Handle Python Arrhenius objects with instance serialize call
98
- reactions_list.append(reaction.serialize())
99
- elif isinstance(reaction, _Branched):
100
- # Handle C++ _Branched objects with static serialize call
101
- reactions_list.append(Branched.serialize_static(reaction))
102
- elif isinstance(reaction, Branched):
103
- # Handle Python Branched objects with instance serialize call
104
- reactions_list.append(reaction.serialize())
105
- elif isinstance(reaction, (_CondensedPhaseArrhenius, CondensedPhaseArrhenius)):
106
- reactions_list.append(
107
- CondensedPhaseArrhenius.serialize_static(reaction))
108
- elif isinstance(reaction, (_CondensedPhasePhotolysis, CondensedPhasePhotolysis)):
109
- reactions_list.append(
110
- CondensedPhasePhotolysis.serialize(reaction))
111
- elif isinstance(reaction, (_Emission, Emission)):
112
- reactions_list.append(Emission.serialize(reaction))
113
- elif isinstance(reaction, _FirstOrderLoss):
114
- # Handle C++ _FirstOrderLoss objects with static serialize call
115
- reactions_list.append(FirstOrderLoss.serialize_static(reaction))
116
- elif isinstance(reaction, FirstOrderLoss):
117
- # Handle Python FirstOrderLoss objects with instance serialize call
118
- reactions_list.append(reaction.serialize())
119
- elif isinstance(reaction, _SimpolPhaseTransfer):
120
- # Handle C++ _SimpolPhaseTransfer objects with static serialize call
121
- reactions_list.append(
122
- SimpolPhaseTransfer.serialize_static(reaction))
123
- elif isinstance(reaction, SimpolPhaseTransfer):
124
- # Handle Python SimpolPhaseTransfer objects with instance serialize call
125
- reactions_list.append(reaction.serialize())
126
- elif isinstance(reaction, _AqueousEquilibrium):
127
- # Handle C++ _AqueousEquilibrium objects with static serialize call
128
- reactions_list.append(
129
- AqueousEquilibrium.serialize_static(reaction))
130
- elif isinstance(reaction, AqueousEquilibrium):
131
- # Handle Python AqueousEquilibrium objects with instance serialize call
132
- reactions_list.append(reaction.serialize())
133
- elif isinstance(reaction, (_WetDeposition, WetDeposition)):
134
- reactions_list.append(WetDeposition.serialize(reaction))
135
- elif isinstance(reaction, (_HenrysLaw, HenrysLaw)):
136
- reactions_list.append(HenrysLaw.serialize(reaction))
137
- elif isinstance(reaction, (_Photolysis, Photolysis)):
138
- reactions_list.append(Photolysis.serialize(reaction))
139
- elif isinstance(reaction, (_Surface, Surface)):
140
- reactions_list.append(Surface.serialize(reaction))
141
- elif isinstance(reaction, _Troe):
142
- # Handle C++ _Troe objects with static serialize call
143
- reactions_list.append(Troe.serialize_static(reaction))
144
- elif isinstance(reaction, Troe):
145
- # Handle Python Troe objects with instance serialize call
146
- reactions_list.append(reaction.serialize())
147
- elif isinstance(reaction, _TernaryChemicalActivation):
148
- # Handle C++ _TernaryChemicalActivation objects with static serialize call
149
- reactions_list.append(TernaryChemicalActivation.serialize_static(reaction))
150
- elif isinstance(reaction, TernaryChemicalActivation):
151
- # Handle Python TernaryChemicalActivation objects with instance serialize call
152
- reactions_list.append(reaction.serialize())
153
- elif isinstance(reaction, _Tunneling):
154
- # Handle C++ _Tunneling objects with static serialize call
155
- reactions_list.append(Tunneling.serialize_static(reaction))
156
- elif isinstance(reaction, Tunneling):
157
- # Handle Python Tunneling objects with instance serialize call
158
- reactions_list.append(reaction.serialize())
159
- elif isinstance(reaction, (_UserDefined, UserDefined)):
160
- reactions_list.append(UserDefined.serialize(reaction))
161
- else:
162
- raise TypeError(
163
- f'Reaction type {type(reaction)} is not supported for export.')
164
-
165
- return {
166
- "name": self.name,
167
- "reactions": reactions_list,
168
- "species": species_list,
169
- "phases": phases_list,
170
- "version": self.version.to_string(),
171
- }
172
-
173
- def export(self, file_path: str) -> None:
174
- MechanismSerializer.serialize(self, file_path)
175
-
176
-
177
- class Parser(_Parser):
178
- """
179
- A class for parsing a chemical mechanism.
180
- """
181
-
182
-
183
- class MechanismSerializer():
184
- """
185
- A class for exporting a chemical mechanism.
186
- """
187
-
188
- @staticmethod
189
- def _convert_cpp_mechanism_to_python(cpp_mechanism: Any) -> Mechanism:
190
- """
191
- Convert a C++ _Mechanism object to a Python Mechanism object.
192
- """
193
- reactions_list = []
194
- for reaction in cpp_mechanism.reactions:
195
- reactions_list.append(reaction)
196
-
197
- python_mechanism = Mechanism(
198
- name=cpp_mechanism.name,
199
- reactions=reactions_list,
200
- species=list(cpp_mechanism.species),
201
- phases=list(cpp_mechanism.phases),
202
- version=Version() if cpp_mechanism.version is None else cpp_mechanism.version
203
- )
204
-
205
- return python_mechanism
206
-
207
- @staticmethod
208
- def serialize(mechanism: Mechanism, file_path: str = "./mechanism.json") -> None:
209
- if not isinstance(mechanism, (Mechanism, _Mechanism)):
210
- raise TypeError(f"Object {mechanism} is not of type Mechanism.")
211
-
212
- directory, file = os.path.split(file_path)
213
- if directory:
214
- os.makedirs(directory, exist_ok=True)
215
-
216
- if isinstance(mechanism, _Mechanism) and not isinstance(mechanism, Mechanism):
217
- mechanism = MechanismSerializer._convert_cpp_mechanism_to_python(
218
- mechanism)
219
-
220
- # Now we can use the standard to_dict method
221
- dictionary = mechanism.to_dict()
222
-
223
- _, file_ext = os.path.splitext(file)
224
- file_ext = file_ext.lower()
225
- if file_ext in ['.yaml', '.yml']:
226
- with open(file_path, 'w') as file:
227
- yaml.dump(dictionary, file)
228
- elif '.json' == file_ext:
229
- json_str = json.dumps(dictionary, indent=4)
230
- with open(file_path, 'w') as file:
231
- file.write(json_str)
232
- else:
233
- raise ValueError(
234
- 'Allowable write formats are .json, .yaml, and .yml')
@@ -1,217 +0,0 @@
1
- from .utils import _add_other_properties
2
- from .species import Species
3
- from .phase import Phase
4
- from typing import Optional, Any, Dict, List, Union, Tuple
5
- from .. import backend
6
-
7
- _backend = backend.get_backend()
8
- _SimpolPhaseTransfer = _backend._mechanism_configuration._SimpolPhaseTransfer
9
- _ReactionComponent = _backend._mechanism_configuration._ReactionComponent
10
- ReactionType = _backend._mechanism_configuration._ReactionType
11
-
12
-
13
- class SimpolPhaseTransfer:
14
- """
15
- A class representing a simplified phase transfer reaction rate constant.
16
-
17
- Attributes:
18
- name (str): The name of the simplified phase transfer reaction rate constant.
19
- gas_phase (Phase): The gas phase in which the reaction occurs.
20
- gas_phase_species (Union[Species, Tuple[float, Species]]): The gas phase species involved in the reaction.
21
- condensed_phase (Phase): The condensed phase in which the reaction occurs.
22
- condensed_phase_species (Union[Species, Tuple[float, Species]]): The condensed phase species involved in the reaction.
23
- B (List[float]): The B parameters [unitless].
24
- other_properties (Dict[str, Any]): A dictionary of other properties of the simplified phase transfer reaction rate constant.
25
- """
26
-
27
- def __init__(
28
- self,
29
- name: Optional[str] = None,
30
- gas_phase: Optional[Phase] = None,
31
- gas_phase_species: Optional[Union[Species,
32
- Tuple[float, Species]]] = None,
33
- condensed_phase: Optional[Phase] = None,
34
- condensed_phase_species: Optional[Union[Species,
35
- Tuple[float, Species]]] = None,
36
- B: Optional[List[float]] = None,
37
- other_properties: Optional[Dict[str, Any]] = None,
38
- ):
39
- """
40
- Initializes the SimpolPhaseTransfer object with the given parameters.
41
-
42
- Args:
43
- name (str): The name of the simplified phase transfer reaction rate constant.
44
- gas_phase (Phase): The gas phase in which the reaction occurs.
45
- gas_phase_species (Union[Species, Tuple[float, Species]]): The gas phase species involved in the reaction.
46
- condensed_phase (Phase): The condensed phase in which the reaction occurs.
47
- condensed_phase_species (Union[Species, Tuple[float, Species]]): The condensed phase species involved in the reaction.
48
- B (List[float]): The B parameters [unitless].
49
- other_properties (Dict[str, Any]): A dictionary of other properties of the simplified phase transfer reaction rate constant.
50
- """
51
- # Create the internal C++ instance
52
- self._instance = _SimpolPhaseTransfer()
53
-
54
- # Set all parameters
55
- if name is not None:
56
- self.name = name
57
- if gas_phase is not None:
58
- self.gas_phase = gas_phase
59
- if gas_phase_species is not None:
60
- self.gas_phase_species = gas_phase_species
61
- if condensed_phase is not None:
62
- self.condensed_phase = condensed_phase
63
- if condensed_phase_species is not None:
64
- self.condensed_phase_species = condensed_phase_species
65
- if B is not None:
66
- self.B = B
67
- if other_properties is not None:
68
- self.other_properties = other_properties
69
-
70
- # Property delegation to self._instance
71
- @property
72
- def name(self) -> str:
73
- """Get the name of the simplified phase transfer reaction rate constant."""
74
- return self._instance.name
75
-
76
- @name.setter
77
- def name(self, value: str):
78
- """Set the name of the simplified phase transfer reaction rate constant."""
79
- self._instance.name = value
80
-
81
- @property
82
- def gas_phase(self) -> str:
83
- """Get the gas phase name."""
84
- return self._instance.gas_phase
85
-
86
- @gas_phase.setter
87
- def gas_phase(self, value: Union[Phase, str]):
88
- """Set the gas phase."""
89
- if isinstance(value, Phase):
90
- self._instance.gas_phase = value.name
91
- elif isinstance(value, str):
92
- self._instance.gas_phase = value
93
- else:
94
- raise ValueError(f"Invalid gas_phase type: {type(value)}")
95
-
96
- @property
97
- def gas_phase_species(self) -> Union[Species, Tuple[float, Species]]:
98
- """Get the gas phase species as Python object."""
99
- rc = self._instance.gas_phase_species
100
- if hasattr(rc, 'coefficient') and rc.coefficient != 1.0:
101
- # Create a tuple with coefficient and species
102
- species = Species(name=rc.species_name)
103
- return (rc.coefficient, species)
104
- else:
105
- # Just the species
106
- return Species(name=rc.species_name)
107
-
108
- @gas_phase_species.setter
109
- def gas_phase_species(self, value: Union[Species, Tuple[float, Species]]):
110
- """Set the gas phase species, converting from Python to C++ object."""
111
- if isinstance(value, Species):
112
- self._instance.gas_phase_species = _ReactionComponent(value.name)
113
- elif isinstance(value, tuple) and len(value) == 2:
114
- coefficient, species = value
115
- self._instance.gas_phase_species = _ReactionComponent(species.name, coefficient)
116
- else:
117
- raise ValueError(f"Invalid gas_phase_species format: {value}")
118
-
119
- @property
120
- def condensed_phase(self) -> str:
121
- """Get the condensed phase name."""
122
- return self._instance.condensed_phase
123
-
124
- @condensed_phase.setter
125
- def condensed_phase(self, value: Union[Phase, str]):
126
- """Set the condensed phase."""
127
- if isinstance(value, Phase):
128
- self._instance.condensed_phase = value.name
129
- elif isinstance(value, str):
130
- self._instance.condensed_phase = value
131
- else:
132
- raise ValueError(f"Invalid condensed_phase type: {type(value)}")
133
-
134
- @property
135
- def condensed_phase_species(self) -> Union[Species, Tuple[float, Species]]:
136
- """Get the condensed phase species as Python object."""
137
- rc = self._instance.condensed_phase_species
138
- if hasattr(rc, 'coefficient') and rc.coefficient != 1.0:
139
- # Create a tuple with coefficient and species
140
- species = Species(name=rc.species_name)
141
- return (rc.coefficient, species)
142
- else:
143
- # Just the species
144
- return Species(name=rc.species_name)
145
-
146
- @condensed_phase_species.setter
147
- def condensed_phase_species(self, value: Union[Species, Tuple[float, Species]]):
148
- """Set the condensed phase species, converting from Python to C++ object."""
149
- if isinstance(value, Species):
150
- self._instance.condensed_phase_species = _ReactionComponent(value.name)
151
- elif isinstance(value, tuple) and len(value) == 2:
152
- coefficient, species = value
153
- self._instance.condensed_phase_species = _ReactionComponent(species.name, coefficient)
154
- else:
155
- raise ValueError(f"Invalid condensed_phase_species format: {value}")
156
-
157
- @property
158
- def B(self) -> List[float]:
159
- """Get the B parameters."""
160
- return self._instance.B
161
-
162
- @B.setter
163
- def B(self, value: List[float]):
164
- """Set the B parameters with validation."""
165
- if not isinstance(value, list) or len(value) != 4:
166
- raise ValueError("B must be a list of 4 elements.")
167
- self._instance.B = value
168
-
169
- @property
170
- def other_properties(self) -> Dict[str, Any]:
171
- """Get the other properties."""
172
- return self._instance.other_properties
173
-
174
- @other_properties.setter
175
- def other_properties(self, value: Dict[str, Any]):
176
- """Set the other properties."""
177
- self._instance.other_properties = value
178
-
179
- @property
180
- def type(self):
181
- """Get the reaction type."""
182
- return ReactionType.SimpolPhaseTransfer
183
-
184
- def serialize(self) -> Dict:
185
- """
186
- Serialize the SimpolPhaseTransfer object to a dictionary using only Python-visible data.
187
-
188
- Returns:
189
- Dict: A dictionary representation of the SimpolPhaseTransfer object.
190
- """
191
- serialize_dict = {
192
- "type": "SIMPOL_PHASE_TRANSFER",
193
- "name": self._instance.name,
194
- "gas phase": self._instance.gas_phase,
195
- "gas-phase species": self._instance.gas_phase_species.species_name,
196
- "condensed phase": self._instance.condensed_phase,
197
- "condensed-phase species": self._instance.condensed_phase_species.species_name,
198
- "B": self._instance.B,
199
- }
200
- _add_other_properties(serialize_dict, self.other_properties)
201
- return serialize_dict
202
-
203
- @staticmethod
204
- def serialize_static(instance) -> Dict:
205
- """
206
- Static serialize method for compatibility with C++ _SimpolPhaseTransfer objects.
207
-
208
- Args:
209
- instance: The _SimpolPhaseTransfer instance to serialize.
210
-
211
- Returns:
212
- Dict: A dictionary representation of the SimpolPhaseTransfer object.
213
- """
214
- # Create a local copy to call serialize
215
- temp_obj = SimpolPhaseTransfer()
216
- temp_obj._instance = instance
217
- return temp_obj.serialize()
@@ -1,52 +0,0 @@
1
- from typing import Optional, Any, Dict
2
- from .. import backend
3
- from .phase import Phase
4
- from .utils import _add_other_properties
5
-
6
- _backend = backend.get_backend()
7
- _WetDeposition = _backend._mechanism_configuration._WetDeposition
8
-
9
-
10
- class WetDeposition(_WetDeposition):
11
- """
12
- A class representing a wet deposition reaction rate constant.
13
-
14
- Attributes:
15
- name (str): The name of the wet deposition reaction rate constant.
16
- scaling_factor (float): The scaling factor for the wet deposition rate constant.
17
- condensed_phase (Phase): The condensed phase which undergoes wet deposition.
18
- unknown_properties (Dict[str, Any]): A dictionary of other properties of the wet deposition reaction rate constant.
19
- """
20
-
21
- def __init__(
22
- self,
23
- name: Optional[str] = None,
24
- scaling_factor: Optional[float] = None,
25
- condensed_phase: Optional[Phase] = None,
26
- other_properties: Optional[Dict[str, Any]] = None,
27
- ):
28
- """
29
- Initializes the WetDeposition object with the given parameters.
30
-
31
- Args:
32
- name (str): The name of the wet deposition reaction rate constant.
33
- scaling_factor (float): The scaling factor for the wet deposition rate constant.
34
- condensed_phase (Phase): The condensed phase which undergoes wet deposition.
35
- other_properties (Dict[str, Any]): A dictionary of other properties of the wet deposition reaction rate constant.
36
- """
37
- super().__init__()
38
- self.name = name if name is not None else self.name
39
- self.scaling_factor = scaling_factor if scaling_factor is not None else self.scaling_factor
40
- self.condensed_phase = condensed_phase.name if condensed_phase is not None else self.condensed_phase
41
- self.other_properties = other_properties if other_properties is not None else self.other_properties
42
-
43
- @staticmethod
44
- def serialize(instance) -> Dict:
45
- serialize_dict = {
46
- "type": "WET_DEPOSITION",
47
- "name": instance.name,
48
- "scaling factor": instance.scaling_factor,
49
- "condensed phase": instance.condensed_phase,
50
- }
51
- _add_other_properties(serialize_dict, instance.other_properties)
52
- return serialize_dict
@@ -1,80 +0,0 @@
1
- musica-0.12.2.dist-info/RECORD,,
2
- musica-0.12.2.dist-info/WHEEL,sha256=qdO6WnDiDW9GigE7BL6ZZjKOjAgb6iacSCh606yDCxw,139
3
- musica-0.12.2.dist-info/entry_points.txt,sha256=t9qRU9Ya63_yYMKJkTiVS5kCaW6dDDr0wuQ26lgXTH8,49
4
- musica-0.12.2.dist-info/METADATA,sha256=FlXiev8ZTGt1gS9XbB3IKm4X5_jaDHB8dmMnUD29alg,26345
5
- musica-0.12.2.dist-info/licenses/AUTHORS.md,sha256=CYIlKZmXT9ngFk6d0MiD0A_Pt8BFoID4n-29OMrKkbM,2632
6
- musica-0.12.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
7
- musica/backend.py,sha256=Ed0vqpdem4a4sz5XOPiBdi1TPQy80qVDcmZUqI5lZvw,1040
8
- musica/CMakeLists.txt,sha256=3b_ipe2i0ZwtLqmmX9-NgF7G4eoq7QN_cnb9eYQ9yqc,1749
9
- musica/_version.py,sha256=hCVcx_5bAXLIccGTgYEYZL1ymSpFddakc6toGfEFtF8,19
10
- musica/constants.py,sha256=RsZrtjy8vlIcQxV9F9xzlSYFeGBQBHmhFWDPB7pRQH8,123
11
- musica/binding_common.cpp,sha256=CigfwqYcETNUe4Ct0P8QMauAFdxPs1iu6ddCqhlckNY,981
12
- musica/__init__.py,sha256=2xoebKVljHzrzupxtAbK3Wg05p38Lq0SFIbDjR0--bs,392
13
- musica/tuvx.py,sha256=utrhxwHw1BsoMri9PxfY_I3ip50JzB5TYwFUZtGBr2I,6388
14
- musica/cpu_binding.cpp,sha256=AZXO6EpL5HofGJ1s11fprrXYVG2U1ZrdUxe3M9j5kpw,225
15
- musica/types.py,sha256=huXgtEf28B13eygMs6TbLkXic9mAifDslY4ONQKpogg,17137
16
- musica/gpu_binding.cpp,sha256=y9Fzgn9unoGz_Fqqlk_NBWy4jHOwTv8E82e3bq_phMg,229
17
- musica/tuvx.cpp,sha256=HnxxysJezO6U6sG9KibHHjfIuKD9KhqHU4Myn5JkmRY,3015
18
- musica/_musica.cpython-39-darwin.so,sha256=qfOWRNZAwFll_Y5Vl7ou_PIGDLS6yrP05g7Ucz_xNxU,3721856
19
- musica/cuda.py,sha256=rtMNdmixfEsy5J4pfKOc6LfBuFECxCKsi8J0jAvtyHo,258
20
- musica/cuda.cpp,sha256=qQOLKTUOB83gE-963rT579Me-NrqMUWnXDKmpTPMVFg,346
21
- musica/binding_common.hpp,sha256=YVG7TS1JeVC4W_yisV4kL61qo3N6Dt6JdAh9bdr6z2w,102
22
- musica/mechanism_configuration.cpp,sha256=iaD8zZvvMH4nt-tZ9dTBsFiqP28xHi5_wpsp07FJ3RM,29105
23
- musica/carma.py,sha256=fmM3K0Rm1hl2l8vGM9mIi0aKgnMhT0xsU3Xo2sP43Ug,66987
24
- musica/main.py,sha256=-TOa-WvGKY1aPewQ2WtzFV3myoEQI6-MYoQt2Hw5GXc,2708
25
- musica/carma.cpp,sha256=K3LxfhzetHeZikSZ_mg1YchmCJ8Sr7eoo55Lu6MBqts,42334
26
- musica/musica.cpp,sha256=Krb2GSVHoXeHZI3cJLXZnQv7MlNlhzOuYV0N-9n3heo,8383
27
- musica/tools/prepare_build_environment_macos.sh,sha256=Yhhd-8W6YvR79NabEqixexU6BsClNf7DH_EYYlsmeMo,41
28
- musica/tools/prepare_build_environment_linux.sh,sha256=zqpqoI3hFYftBfj2MTpHz2Gg3TGVhcJ1U2z7IauSPug,986
29
- musica/tools/repair_wheel_gpu.sh,sha256=GJcKUJ2n9KMsj3QC5Shxt_ks9uFu2f9Than-4vVhG9U,1485
30
- musica/test/unit/test_parser.py,sha256=RhDWTmX2E9RiISFuKyqH3DJn38sxfaSfgzxPM-Rs1h0,2603
31
- musica/test/unit/test_serializer.py,sha256=U0aQwXtOwdpFlfJH915rLikde7U97pJ1p0KiH2__jro,2458
32
- musica/test/unit/test_util_full_mechanism.py,sha256=9_n8_RbG3X60YGV59mOpp_hvsh6-hMKhXZCijE5beRg,25217
33
- musica/test/unit/test_state.py,sha256=JOoFKCQBYK93hRh5XWW5JBmHhgR9uPIsiGKmCBkpXzo,10369
34
- musica/test/integration/test_chapman.py,sha256=gOISpApVIMLCEv6W0Hq1yNGF0xu2MlZMHQQhOGPmoQI,3512
35
- musica/test/integration/test_sulfate_box_model.py,sha256=Ww6rI8_f4vgiYZ2_pt6hFu13abNaOm8i1TocISYET_s,1604
36
- musica/test/integration/test_carma_aluminum.py,sha256=B4xpfYEQxQIeUe5TcAXdtS4s1yD9cd6dQFZSUXY8ZLM,356
37
- musica/test/integration/test_carma_sulfate.py,sha256=6SWcRjKY96uJhk4ifqiwTjFmH396j3i4bUfKXoJMtNI,742
38
- musica/test/integration/test_tuvx.py,sha256=9jQvE-LxTRPpoKXi3JponF1G4-xcAhhE1sLX1KV-EOQ,1918
39
- musica/test/integration/test_carma.py,sha256=iR6FnhSfG6seta4K-C9IPtYdia9GlH8DzyVyP3w07zc,6865
40
- musica/test/integration/test_analytical.py,sha256=3P9pw7mRnXi7oXn_2vdEZSBFc4U5m0eRJgKEvX3esZ8,13805
41
- musica/test/examples/v1/full_configuration/full_configuration.yaml,sha256=cLyG0HJP2Jxl44e52Z94R6_WGsGLBjXAWiOIfDk1yuY,5617
42
- musica/test/examples/v1/full_configuration/full_configuration.json,sha256=WfJ2hw-XOhrM9RRAYrdW5C_9bc7ACB835xKWK5UWUhY,9437
43
- musica/.dylibs/libhdf5.310.5.1.dylib,sha256=83ZEgjgvsW-33kHKGygxRBjKqJd1WretY1xMvGMHCIU,3277072
44
- musica/.dylibs/libaec.0.1.4.dylib,sha256=_C-rTFuk7CkvfqzOFQrY4CqNXfhtaQ0ckGkUYP_F6ew,70928
45
- musica/.dylibs/libnetcdf.22.dylib,sha256=f5kk7mMIK1ia2Ac8IiKAkXQbq6V2g_5Em7Kkgg_m10Y,1309456
46
- musica/.dylibs/libgfortran.5.dylib,sha256=etZfelp8uKAtQO-lkhokXOX7mWXe6V6_sVQkxx-Xjbw,2161472
47
- musica/.dylibs/libsz.2.0.1.dylib,sha256=jkXYTFpNzAsfqN64UMAJVGZfThfQ_rNkzku2cS3xTIg,71344
48
- musica/.dylibs/libhdf5_hl.310.0.6.dylib,sha256=spwH6SJg-kdpEEdrlii-NH_T7hCYy7yv2Kgbaxiec3Q,155824
49
- musica/.dylibs/libquadmath.0.dylib,sha256=ZVBFvjKhF2_mty4vnshhdHtpOLncbg3u8diBtK4Trps,362768
50
- musica/.dylibs/libgcc_s.1.1.dylib,sha256=p4iJ87gq_K353gV1yo8ih7TVYCLiu3yLvogtuxSVAjs,220288
51
- musica/.dylibs/libnetcdff.7.1.0.dylib,sha256=9HqSrG2wkwdrs-0-4N_5wrVOfaQ89GGbH4iT-4iBTyw,894768
52
- musica/.dylibs/libzstd.1.5.7.dylib,sha256=MQGj484yvsxhgqlQFGJtjbuBR0MOBVImXwujJ7rO0Hk,654000
53
- musica/mechanism_configuration/phase.py,sha256=rOEExkNxrzHQSKwclrnQltXzanWnLA9vt5UFDnbQOi4,1633
54
- musica/mechanism_configuration/species.py,sha256=JyNPFVH9abznBb-pNLHVKynU6qx7s2PzGt2gXDcM-jI,5453
55
- musica/mechanism_configuration/henrys_law.py,sha256=aLgVAWROMxOfx0ng_FOovZeTWXXtfD8Kz-GwGn_2Fi8,1563
56
- musica/mechanism_configuration/tunneling.py,sha256=zGEVG034ERLHgx9HW74SYlTbb-_LPSvEeIdKvrvc3qA,9378
57
- musica/mechanism_configuration/mechanism_configuration.py,sha256=6t3ulJpXZhXe-XNpjfKkhu5FlmjLOwg3a10cWC0gEjY,10437
58
- musica/mechanism_configuration/branched.py,sha256=WWYVSRv2yTAvLe91zUsmqeTL0PAAKEIY7t9zujYRGgE,11762
59
- musica/mechanism_configuration/reactions.py,sha256=R3uJwDXMtu1r2xijBmq1FsaMqzKQXqFqteho7leQ8hc,2367
60
- musica/mechanism_configuration/__init__.py,sha256=LwedZpjLpPM5wUGzVx7mv9HreL8DCbzZQedtcp0OWYM,39
61
- musica/mechanism_configuration/user_defined.py,sha256=E5pioPg7UQVY6eUe7wvzwC_2ooCwliAPWl_9Do5EX_g,3892
62
- musica/mechanism_configuration/aqueous_equilibrium.py,sha256=QCWH6IfdpY_vQXEdwnWiXpkJEfpINAhPp9L8gRNnFjY,10996
63
- musica/mechanism_configuration/condensed_phase_arrhenius.py,sha256=XX_t-54FFGFKJrorsGxS3MVBV5CMLIMpSBN6I3HMbho,11436
64
- musica/mechanism_configuration/first_order_loss.py,sha256=6IMOoX7ykECgPCVokcaVsJM1712P4bVjqvldk-chPQk,6641
65
- musica/mechanism_configuration/utils.py,sha256=nR-ukwYsplFfnsjXtKQsXnryMPvtjkZkFQv7TjcSrnE,346
66
- musica/mechanism_configuration/wet_deposition.py,sha256=ROc57JgXTxCCoGCSvNUZMXkAMLqcT9PVfuIDGNXT65U,2254
67
- musica/mechanism_configuration/condensed_phase_photolysis.py,sha256=KxnCUvgvIidLWXsVdPkGFbcEuxyuQ_8PPubw3x05EBI,4115
68
- musica/mechanism_configuration/arrhenius.py,sha256=0B0fT1mzajyJ68Ns-bdxjDsh7btBf4r1UYIgInZ9_FE,11172
69
- musica/mechanism_configuration/troe.py,sha256=1uj0vL4-Vzk1Ue2j-v1G3FrVsQ0bRpfOnMHzphUsL2U,13607
70
- musica/mechanism_configuration/simpol_phase_transfer.py,sha256=o-JPNwPVJtBpRsmiIzDJ-iNWU-L8lk8uCI9FvbC_FQY,9061
71
- musica/mechanism_configuration/photolysis.py,sha256=f6LQmsL9NmUyy7cp8PPU0zI2sExcyirJ62LmzcfFB_U,3883
72
- musica/mechanism_configuration/emission.py,sha256=HS1QVJWYj4Omk2lK_NrxFFPeEu_HLXaSGAG0I0BXU4s,3044
73
- musica/mechanism_configuration/surface.py,sha256=2cFsIvFvL8lmxe0c8cB9LYDjg4qD6Y020ZziCjT6iaw,4346
74
- musica/mechanism_configuration/ternary_chemical_activation.py,sha256=AlY9yFq0ZXgEnUaNd249wrgmYyW1TvkzOi2ZoK4B3gQ,14323
75
- musica/examples/__init__.py,sha256=A4k3hoNAvcGzHlzJZ9yuy9H2n1jTSJzB6LsS7veUa_w,31
76
- musica/examples/carma_sulfate.py,sha256=Jmm8CLyBtNDK06Hb94jsnR-hVGxZNES3HNxrIrHIW84,8119
77
- musica/examples/sulfate_box_model.py,sha256=cf0-_Z8rrTSxFrFPjIwYDYZcwNdiiYnk6IZ2zPH1cTo,16671
78
- musica/examples/examples.py,sha256=087VoazqnByZSjMEb_Vo1KoUNOO0xRw_fQ9XY7eitNc,5736
79
- musica/examples/ts1_latin_hypercube.py,sha256=v6FhWxVQSZJvj55XblsIGVdq4f7CucttxDKjVlz6k1A,9623
80
- musica/examples/carma_aluminum.py,sha256=tYji_Gna2VoKVFxzNOymeIqRzLvGo0PRefeyqaK0N-k,3684