-
Notifications
You must be signed in to change notification settings - Fork 104
Pybind rd file view #1244
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
Merged
Merged
Pybind rd file view #1244
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
070cebe
Remove test that is not built
eivindjahren b658279
Use pybind for ResdataFileView
eivindjahren 20b35f1
Remove extern "C" around rd_file_view.hpp
eivindjahren 13a5e92
Use constructor for rd_file_view_alloc
eivindjahren f27afba
Use std::string for iget_distinct_kw
eivindjahren 733d47e
Simplify check_flags
eivindjahren 32fb6e2
Change util_abort to thrown exception
eivindjahren 79f77b2
Remove unnecessary comments
eivindjahren 5e98736
Inline sim
eivindjahren 1a80cea
Fixed misspelled PARALLEL
eivindjahren d8a0bda
Use pybind for FileMode enum
eivindjahren 8213663
Fix spelling mistakes in rd_sum_data.cpp docs
eivindjahren 462a738
Move rd_file_view_struct to header
eivindjahren b388ee9
Use constructor and destructor for rd_file_view_struct
eivindjahren 3e30664
Rename rd_file_struct to FileView
eivindjahren be1339f
Remove extern "C" around well_rseg_loader
eivindjahren 6df9cb6
Use pybind to define rd_file_view
eivindjahren acfb6c5
Use size_t for rd_file_fwrite_fortio
eivindjahren 290c771
Remove unused map_stack
eivindjahren cacc8a6
Add .pyi files for FileMode and ResdataFileView
eivindjahren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #pragma once | ||
|
|
||
| #include <type_traits> | ||
|
|
||
| enum class FileMode : int { | ||
| DEFAULT = 0, | ||
| CLOSE_STREAM = | ||
| 1, /* This flag will close the underlying FILE object between each access; | ||
| this is mainly to save filedescriptors in cases where many rd_file | ||
| instances are open at the same time. */ | ||
| WRITABLE = | ||
| 2 /* This flag opens the file in a mode where it can be updated and modified, | ||
| but it must still exist and be readable. I.e. this should not compared | ||
| with the normal: fopen(filename , "w") where an existing file is | ||
| truncated to zero upon successfull open. */ | ||
| }; | ||
|
|
||
| constexpr FileMode operator|(FileMode lhs, FileMode rhs) { | ||
| using T = std::underlying_type_t<FileMode>; | ||
| return static_cast<FileMode>(static_cast<T>(lhs) | static_cast<T>(rhs)); | ||
| } | ||
|
|
||
| constexpr FileMode operator&(FileMode lhs, FileMode rhs) { | ||
| using T = std::underlying_type_t<FileMode>; | ||
| return static_cast<FileMode>(static_cast<T>(lhs) & static_cast<T>(rhs)); | ||
| } | ||
|
|
||
| constexpr FileMode operator^(FileMode lhs, FileMode rhs) { | ||
| using T = std::underlying_type_t<FileMode>; | ||
| return static_cast<FileMode>(static_cast<T>(lhs) ^ static_cast<T>(rhs)); | ||
| } | ||
|
|
||
| constexpr FileMode operator~(FileMode value) { | ||
| using T = std::underlying_type_t<FileMode>; | ||
| return static_cast<FileMode>(~static_cast<T>(value)); | ||
| } | ||
|
|
||
| constexpr FileMode &operator|=(FileMode &lhs, FileMode rhs) { | ||
| lhs = lhs | rhs; | ||
| return lhs; | ||
| } | ||
|
|
||
| constexpr FileMode &operator&=(FileMode &lhs, FileMode rhs) { | ||
| lhs = lhs & rhs; | ||
| return lhs; | ||
| } | ||
|
|
||
| constexpr FileMode &operator^=(FileMode &lhs, FileMode rhs) { | ||
| lhs = lhs ^ rhs; | ||
| return lhs; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.