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

Parse comma-delimited ~ASCII sections #265 #485

Merged

Conversation

dcslagel
Copy link
Collaborator

@dcslagel dcslagel commented Aug 10, 2021

Description:

Parse comma-delimited ~ASCII sections #265. This is primarily for parsing the data section of LAS-3.0 files. It should work for LAS-3.0 files using the standard Curves, Parameter, and ASCII sections and for LAS-3.0 files using the Log_Definition, Log_Parameter and Log_Data sections.

Change Details:

  • Add define_line_splitter(). It will configure a line_splitter()
    function based on the identified data delimiter. This works for
    the normal engine. The numpy engine still needs work
  • Add comma-delimiter regexp list to defaults.py::READ_POLICIES
  • Add provisional_delimiter variable to hold the identifed delimiter
  • Move the call to reader.get_substitutions() to after
    provisional_delimter is fully defined.
  • Load the las3_data_section_indices as data_section_indicies if
    after initial scan of the las file the original data_section_inidices
    is empty and las3_data_section_indicies is populated
  • Add the line_splitter func as a parameter when calling
    reader.read_data_section_iterative_normal_engine()
  • Add logic conditional to associate the ~Log_* sections with the standard equivalent sections.

Notes:

  • This change works with the normal parsing engine.

I left these changes out of this specific pull-request. They can be implemented in future pull-requests

  • Making the update for the "Numpy" parsing engine .
  • Add a parameter enabling the user to specify which Data Delimiter to parse the data with.

Test-Results

All tests pass.
One of the LAS-3.0 tests is updated to reflect that the change will store a LAS-3.0 ~Log_Definition sections data in Lasio's Curve section and the LAS-3.0's ~Log_Parameter section in Lasio's Parameter section.

Name                       Stmts   Miss  Cover
----------------------------------------------
lasio/__init__.py             28      6    79%
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                 503     72    86%
lasio/las_items.py           199     29    85%
lasio/las_version.py          50     14    72%
lasio/reader.py              463     28    94%
lasio/writer.py              200     10    95%
----------------------------------------------
TOTAL                       1610    223    86%

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

Thank you,
DC

- Add define_line_splitter(). It will configure a line_splitter()
  function based on the identified data delimiter. This works for
  the normal engine. The numpy engine still needs work
- Add comma-delimiter regexp list to defaults.py::READ_POLICIES
- Add provisional_delimiter variable to hold the identifed delimiter
- Move the call to reader.get_substitutions() to after
  provisional_delimter is fully defined.
- Load the las3_data_section_indices as data_section_indicies if
  after initial scan of the las file the original data_section_inidices
  is empty and las3_data_section_indicies is populated
- Add the line_splitter func as a parameter when calling
  reader.read_data_section_iterative_normal_engine()
- Note: some test fail with this commit.
@dcslagel dcslagel marked this pull request as draft August 10, 2021 22:28
@dcslagel dcslagel changed the title Interim development changes for Parse comma-delimited ~ASCII sections #265 Draft changes for Parse comma-delimited ~ASCII sections #265 Aug 10, 2021
@dcslagel dcslagel requested a review from kinverarity1 August 11, 2021 23:10
@dcslagel dcslagel marked this pull request as ready for review August 11, 2021 23:10
@dcslagel dcslagel changed the title Draft changes for Parse comma-delimited ~ASCII sections #265 Parse comma-delimited ~ASCII sections #265 Aug 11, 2021
@dcslagel dcslagel added the las3 stuff relating to LAS 3.0 label Aug 16, 2021
Copy link
Owner

@kinverarity1 kinverarity1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thank you so much for this! 🔥 🎈

@dcslagel dcslagel merged commit e32f885 into kinverarity1:master Sep 20, 2021
@dcslagel dcslagel deleted the issue-265-parse-comma-delimited-data branch July 20, 2022 17:29
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
las3 stuff relating to LAS 3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants