Skip to content
New issue

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

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

Already on GitHub? # to your account

Some updates to rounding behavior when writing for issue 453 #455

Merged

Conversation

dcslagel
Copy link
Collaborator

@dcslagel dcslagel commented Apr 21, 2021

Description:

This pull-request resolves the issues identified in rounding issues when writing las file #453.

  1. Updates for rounding behavior when writing:
  • If we are getting STRT and STOP from the data then format them to a
    standard precision. Current default precision is "%.5f".
  • If STRT and STOP are passed in with values, don't format them because
    we assume they are at the user's expected precision.
  • Update failing test cases to have the correct STOP value.
  • Add a test case for the case where a LAS file does not have a correct
    STOP value.
  • Move updating units to a separate LASFile method so that units are
    always synced between las.curves.unit and las.well..unit.
  1. Enable writing empty LAS file:
  • Handle exceptions on empty data
  • Add test case for writing an empty LAS file: test_write_empty_las()

Testing Results:

Name                       Stmts   Miss  Cover
----------------------------------------------
lasio/__init__.py             13      2    85%
lasio/convert_version.py      20     20     0%
lasio/defaults.py             11      0   100%
lasio/examples.py             42     10    76%
lasio/excel.py                88     34    61%
lasio/exceptions.py            6      0   100%
lasio/las.py                 436     59    86%
lasio/las_items.py           199     29    85%
lasio/las_version.py          50     14    72%
lasio/reader.py              396     25    94%
lasio/writer.py              171      9    95%
----------------------------------------------
TOTAL                       1432    202    86%


- benchmark: 1 tests -------------------------------
Name (time in s)                Min     Max    Mean  
----------------------------------------------------
test_read_v12_sample_big     944.9445  957.4294  950.0452
---------------------------------------------------

--
Let me know if this change could be accepted (or rejected) or
needs some additional changes to be approved and merged.

Thank you,
DC

- If we are getting STRT and STOP from the data then format them to a
  standard precision. Current default precision is "%.5f".
- If STRT and STOP are passed in with values, don't format them because
  we assume they are at the user's expected precision.
- Update failing test cases to have the correct STOP value.
- Add a test case for the case where a LAS file does not have a correct
  STOP value.
- Move updating units to a separate LASFile method so that units are
  always synced between las.curves.unit and las.well.<step>.unit.
@dcslagel dcslagel force-pushed the rounding-issues-when-writing branch from 16c19c5 to 119fb31 Compare April 21, 2021 22:36
@dcslagel dcslagel marked this pull request as ready for review April 21, 2021 22:43
@dcslagel dcslagel requested a review from kinverarity1 April 21, 2021 22:43
@dcslagel dcslagel changed the title Explore solution for rounding issues when writing Some updates to rounding behavior when writing Apr 21, 2021
@dcslagel dcslagel changed the title Some updates to rounding behavior when writing Some updates to rounding behavior when writing for issue 453 Apr 21, 2021
- Handle exceptions on empty data
- Add test case for writing an empty LAS file: test_write_empty_las()
@dcslagel dcslagel force-pushed the rounding-issues-when-writing branch from 0ddd8ea to 43d07c4 Compare April 22, 2021 18:27
@kinverarity1
Copy link
Owner

Looks great thank you.

@kinverarity1 kinverarity1 merged commit 6f323ac into kinverarity1:master Apr 23, 2021
@dcslagel dcslagel deleted the rounding-issues-when-writing branch July 20, 2022 17:29
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants