Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand Gas builder test #483

Open
Gorkowski opened this issue Oct 4, 2024 · 1 comment
Open

Expand Gas builder test #483

Gorkowski opened this issue Oct 4, 2024 · 1 comment
Labels
sourcery-ai sourcery-ai

Comments

@Gorkowski
Copy link
Collaborator

suggestion (testing): Enhance test_gas_builder_with_species with more detailed assertions

Consider adding assertions to verify the properties of the added species in the atmosphere. This would ensure that the species are correctly added and their properties are preserved.

def test_gas_builder_with_species():
"""Test building a Gas object with the GasBuilder."""
vapor_pressure_strategy_atmo = ConstantVaporPressureStrategy(
vapor_pressure=np.array([101325, 101325, 101325]))
names_atmo = np.array(["Oxygen", "Nitrogen", "Carbon Dioxide"])
molar_masses_atmo = np.array([0.032, 0.028, 0.044])
condensables_atmo = np.array([False, False, True])
concentrations_atmo = np.array([0.21, 0.79, 0.0])
gas_species_builder_test = GasSpecies(
name=names_atmo,
molar_mass=molar_masses_atmo,
vapor_pressure_strategy=vapor_pressure_strategy_atmo,
condensable=condensables_atmo,
concentration=concentrations_atmo
)
atmo = (
AtmosphereBuilder()
.set_temperature(298.15)
.set_pressure(101325)
.add_species(gas_species_builder_test)
.build()
)

assert atmo.temperature == 298.15
assert atmo.total_pressure == 101325
assert len(atmo.species) == 1
assert np.array_equal(atmo.species[0].name, names_atmo)
assert np.array_equal(atmo.species[0].molar_mass, molar_masses_atmo)
assert np.array_equal(atmo.species[0].condensable, condensables_atmo)
assert np.array_equal(atmo.species[0].concentration, concentrations_atmo)
@mahf708 mahf708 added the sourcery-ai sourcery-ai label Oct 6, 2024
Copy link

github-actions bot commented Dec 6, 2024

This will be closed soon due to inactivity

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

No branches or pull requests

2 participants