Open srivatsamr opened 4 weeks ago
Thanks for the feedback @srivatsamr!
I'll take a closer look when I get time, but I don't doubt there's issues as the whole units part was not well implemented. Longer term I want to make the engine dimensionless and then call stuff like dls
as a method that checks dimensions.
In the meantime, I would suggest assuming that the survey
module works in meters and transform your input into meters (using the units
module for example, which is just a wrapper on the pint
library) and then converting back to your unit of choice after.
Firstly, thanks for creating and sharing this awesome project!
Description
I believe there is a bug in the
_interpolate_survey
function in the survey module while handling the units. When working in the units offeet
, this function throws the following error:AssertionError: inconsistent units with header
.Here is a minimal reproducer:
Bug
In the
_interpolate_survey
function, a new instance ofSurvey
is created: https://github.com/jonnymaserati/welleng/blob/bc20a3b90fbfb30ed5da3a3cf64e611713150cc7/welleng/survey.py#L1624While the
header
having units offeet
is passed into the argument , theunit
argument is left to default which ismeters
, causing thisAssertionError
. I guess settingunit=sh.depth_unit
would resolve this.Thanks!