I've been watching your development for a while now and it is really impressive!
As my contribution to your wonderful package, I've developed two classes that may help on code modularization and reuse.
The AirProperties class is a simple interface to the air_properties function, that can have values reset and recalculate its own properties.
The Material class is an abstraction of a single material being studied, it holds physical information such as its thickness, porosity, tortuosity, etc, and also a reference to air properties and an array of frequencies to be modelled against.
The great trick here is the estimate_absorption method, which take a simple string with the absorption model name (e.g. "biot-allard" for Biot-Allard model), or even easier, only the model initials (e.g. "db" for Delany-Bazley model).
It also allows the use of model variations, such as the "allard" or "lafarge" versions of the Johnson-Champoux model by passing the corresponding string argument to the var parameter.
I've taken the care to document the most of it and work on two example codes that does the same job as the
example_johnson_champoux.py code.
Feel free to question or to make any suggestions.
Stay safe, wear mask and keep coding :D
I've been watching your development for a while now and it is really impressive!
As my contribution to your wonderful package, I've developed two classes that may help on code modularization and reuse.
The
AirProperties
class is a simple interface to theair_properties
function, that can have values reset and recalculate its own properties.The
Material
class is an abstraction of a single material being studied, it holds physical information such as its thickness, porosity, tortuosity, etc, and also a reference to air properties and an array of frequencies to be modelled against.The great trick here is the
estimate_absorption
method, which take a simple string with the absorption model name (e.g."biot-allard"
for Biot-Allard model), or even easier, only the model initials (e.g."db"
for Delany-Bazley model).It also allows the use of model variations, such as the
"allard"
or"lafarge"
versions of the Johnson-Champoux model by passing the corresponding string argument to thevar
parameter.I've taken the care to document the most of it and work on two example codes that does the same job as the
example_johnson_champoux.py
code.Feel free to question or to make any suggestions. Stay safe, wear mask and keep coding :D