-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add rft to files #281
Add rft to files #281
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #281 +/- ##
==========================================
- Coverage 92.90% 92.88% -0.03%
==========================================
Files 161 161
Lines 10578 10605 +27
==========================================
+ Hits 9828 9850 +22
- Misses 750 755 +5 ☔ View full report in Codecov by Sentry. |
"""Class for handling output requests in Nexus.""" | ||
date: str | ||
output: str | ||
output_type: OutputType | ||
output_frequency: FrequencyEnum | ||
output_frequency_number: None | float | ||
|
||
def to_table_line(self, headers: list[str]) -> str: | ||
"""String representation of the single line within an Output request table.""" | ||
_ = headers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slightly confused on this statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the _ = headers
is to dispose of the headers variable which is required to match the variables from the parent class but not required for this object.
@staticmethod | ||
def get_keyword_mapping() -> dict[str, tuple[str, type]]: | ||
return {} | ||
|
||
|
||
@dataclass(kw_only=True) | ||
class NexusOutputContents: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc string needed here?
@@ -223,3 +248,14 @@ def _get_output_contents(table_file_as_list: list[str], date: str, output_type: | |||
resulting_output_contents.append(output_contents_obj) | |||
|
|||
return resulting_output_contents | |||
|
|||
def _add_array_output_request(self, output_request: NexusOutputRequest) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider doc string
if headers: | ||
write_out_headers = ' '.join(headers) | ||
new_table_as_list.append(write_out_headers) | ||
new_table_as_list.append(new_obj.to_table_line(headers=headers)) | ||
new_table_as_list.append(self.table_footer) | ||
new_table_as_list = [x + '\n' if not x.endswith('\n') else x for x in new_table_as_list] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice list comprehension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, please have a look at Keith's comments though.
Reuses code from the add_operators to be able to add any request for data outputs. To make a fully functioning "add_rft" method we would need to be able to add to "WELLLIST" in the network file. #282