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

:1 :2 should only be appended to mnemonics when using LASFile.read #478

Closed
kinverarity1 opened this issue Jul 14, 2021 · 0 comments
Closed
Labels

Comments

@kinverarity1
Copy link
Owner

Describe the bug
Confusing overloaded behaviour with LASFile.__setitem__ which creates duplicate mnemonics with appended :1, :2 when trying to update curves.

To Reproduce

>>> import lasio.examples
>>> las = lasio.examples.open("sample.las")
>>> print(las.curves)
Mnemonic  Unit  Value  Description
--------  ----  -----  -----------
DEPT      M            1  DEPTH
DT        US/M         2  SONIC TRANSIT TIME
RHOB      K/M3         3  BULK DENSITY
NPHI      V/V          4   NEUTRON POROSITY
SFLU      OHMM         5  RXO RESISTIVITY
SFLA      OHMM         6  SHALLOW RESISTIVITY
ILM       OHMM         7  MEDIUM RESISTIVITY
ILD       OHMM         8  DEEP RESISTIVITY
>>> las["ILD_MSM"] = 100 / las["ILD"]
>>> print(las.curves)
Mnemonic  Unit  Value  Description
--------  ----  -----  -----------
DEPT      M            1  DEPTH
DT        US/M         2  SONIC TRANSIT TIME
RHOB      K/M3         3  BULK DENSITY
NPHI      V/V          4   NEUTRON POROSITY
SFLU      OHMM         5  RXO RESISTIVITY
SFLA      OHMM         6  SHALLOW RESISTIVITY
ILM       OHMM         7  MEDIUM RESISTIVITY
ILD       OHMM         8  DEEP RESISTIVITY
ILD_MSM
>>> # Whoops, typo, let's do that again
>>> las["ILD_MSM"] = 1000 / las["ILD"]
>>> print(las.curves)
Mnemonic   Unit  Value  Description
--------   ----  -----  -----------
DEPT       M            1  DEPTH
DT         US/M         2  SONIC TRANSIT TIME
RHOB       K/M3         3  BULK DENSITY
NPHI       V/V          4   NEUTRON POROSITY
SFLU       OHMM         5  RXO RESISTIVITY
SFLA       OHMM         6  SHALLOW RESISTIVITY
ILM        OHMM         7  MEDIUM RESISTIVITY
ILD        OHMM         8  DEEP RESISTIVITY
ILD_MSM:1
ILD_MSM:2

Expected behavior
This line:

>>> las["ILD_MSM"] = 1000 / las["ILD"]
>>> print(las)

Should have resulted in this:

Mnemonic  Unit  Value  Description
--------  ----  -----  -----------
DEPT      M            1  DEPTH
DT        US/M         2  SONIC TRANSIT TIME
RHOB      K/M3         3  BULK DENSITY
NPHI      V/V          4   NEUTRON POROSITY
SFLU      OHMM         5  RXO RESISTIVITY
SFLA      OHMM         6  SHALLOW RESISTIVITY
ILM       OHMM         7  MEDIUM RESISTIVITY
ILD       OHMM         8  DEEP RESISTIVITY
ILD_MSM

Not this:

Mnemonic   Unit  Value  Description
--------   ----  -----  -----------
DEPT       M            1  DEPTH
DT         US/M         2  SONIC TRANSIT TIME
RHOB       K/M3         3  BULK DENSITY
NPHI       V/V          4   NEUTRON POROSITY
SFLU       OHMM         5  RXO RESISTIVITY
SFLA       OHMM         6  SHALLOW RESISTIVITY
ILM        OHMM         7  MEDIUM RESISTIVITY
ILD        OHMM         8  DEEP RESISTIVITY
ILD_MSM:1
ILD_MSM:2

Software versions (please complete the following information):

  • lasio version (import lasio; print(lasio.__version__)) master branch

Additional context
The addition of :1, :2 etc should only happen when using LASFile.read

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

No branches or pull requests

1 participant