Implement interactive selector of trace headers specs#12
Open
alexanderkuvaev wants to merge 10 commits intomainfrom
Open
Implement interactive selector of trace headers specs#12alexanderkuvaev wants to merge 10 commits intomainfrom
alexanderkuvaev wants to merge 10 commits intomainfrom
Conversation
| self.file_n_traces = self.loader.n_traces | ||
| self.n_traces = min(n_traces, self.file_n_traces) | ||
|
|
||
| self.dtype_str_to_np = { |
Member
There was a problem hiding this comment.
Why not a class attribute?
| Anchor for resolving the package name. Used only for relative imports. | ||
| attribute : str, optional | ||
| Name of attribute to get from loaded module. | ||
| help : str, optional |
Member
There was a problem hiding this comment.
Add a use-case as an example
|
|
||
| WIDGET_HEIGHT = "30px" | ||
| BUTTON_WIDTH = "35px" | ||
| title_layout = widgets.Layout(height=WIDGET_HEIGHT, width="auto", flex="1 1 auto") |
Member
There was a problem hiding this comment.
What do you think about put all layout kwargs to some default config to have an ability to change them?
| TEXT_HEADER_LINE_LENGTH = 80 | ||
| text_header_list = [] | ||
| for text_header in self.loader.text: | ||
| text_header = text_header.decode(errors="replace") |
Member
There was a problem hiding this comment.
Do we really can use system encoding?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a number of utils to perform interactive selection and validation of trace header specs:
TraceHeaderSpecSelector- a base class that defines a widget which allows specifying custom start bytes, dtypes and endiannesses of trace headers and displays loaded values for a subset of traces. It also prints textual headers of the file since they usually contain information about headers' locations.select_pre_stack_header_specsandselect_post_stack_header_specs- thin wrappers aroundTraceHeaderSpecSelectorwith predefined sets of headers to validate for pre-stack and post-stack SEG-Y files respectively.The resulting header specs can be accessed via
headersattribute of the returned object:Other changes:
extras_requireblock insetup.pywith optional interactive dependenciesDelayedImportfrombatchflownext to as well copy-pastedForPoolExecutor😢TraceHeaderSpec.is_standardcheck