Skip to content

re-writing dlis file opened with dlisio - helper function and example#45

Merged
the-mysh merged 4 commits into
well-id:develfrom
ltbrizolara:devel
May 5, 2025
Merged

re-writing dlis file opened with dlisio - helper function and example#45
the-mysh merged 4 commits into
well-id:develfrom
ltbrizolara:devel

Conversation

@ltbrizolara
Copy link
Copy Markdown
Contributor

Hi,

  • I added a helper /utils/import_from_dlisio.py - Passes all DLIS data of a file read with dlisio to a dliswriter DLISFile object.

    • Also included a minimal option, to pass along just the logical files, origins, frames and channels. This is to facilitate for users that are solely interested in the numeric log data and could be stopped by problems in the large amount of other objects of the DLIS specification, that can cause problems.
  • Also added an examples/create_dlis_from_dlisio.py showing how to use it and comparing the log numeric data of the input and output files.

@the-mysh
Copy link
Copy Markdown
Collaborator

Looks great to me! Just a small thing, would you mind fixing the type hinting and formatting? I've re-run the mypy and flake8 jobs, so they should now show a list of issues.

@ltbrizolara
Copy link
Copy Markdown
Contributor Author

Looks great to me! Just a small thing, would you mind fixing the type hinting and formatting? I've re-run the mypy and flake8 jobs, so they should now show a list of issues.

Should be clean now! In import_from_dlisio's def add_groups it's not clear to me how I should tell the types of general dlisio objects, so just added two # type: ignore there. I hope it's fine.

@the-mysh
Copy link
Copy Markdown
Collaborator

Hi @ltbrizolara , apologies for the (Easter) delay and thanks for the fixes! Yeah, the ignore's should be fine. There are still some more things that mypy is complaining about though. It just tends to flag one thing at a time; you've added type hints for the return values, so it's only now checking the type hints for arguments. And, for some reason, GitHub jobs only work when I re-run them, which doesn't make it easier. But, I think, you should be able to run mypy locally; if you just do mypy . while being inside src, it should take into account the mypy.ini config file.
Company policy, sorry!

@ltbrizolara
Copy link
Copy Markdown
Contributor Author

Hi @ltbrizolara , apologies for the (Easter) delay and thanks for the fixes! Yeah, the ignore's should be fine. There are still some more things that mypy is complaining about though. It just tends to flag one thing at a time; you've added type hints for the return values, so it's only now checking the type hints for arguments. And, for some reason, GitHub jobs only work when I re-run them, which doesn't make it easier. But, I think, you should be able to run mypy locally; if you just do mypy . while being inside src, it should take into account the mypy.ini config file. Company policy, sorry!

No problem! ;) In fact I had mypy on standard settings, not on the mypy.ini, thanks! It is passing now!

@the-mysh
Copy link
Copy Markdown
Collaborator

the-mysh commented May 5, 2025

Awesome, thanks so much!

@the-mysh the-mysh merged commit 781a5a4 into well-id:devel May 5, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants