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

Add rft to files #281

Merged
merged 10 commits into from
Feb 27, 2024
Merged

Add rft to files #281

merged 10 commits into from
Feb 27, 2024

Conversation

jonnyh404
Copy link
Collaborator

@jonnyh404 jonnyh404 commented Feb 20, 2024

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

@jonnyh404 jonnyh404 marked this pull request as draft February 20, 2024 17:10
@jonnyh404 jonnyh404 self-assigned this Feb 20, 2024
Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 92.88%. Comparing base (9ea2c84) to head (1d3031d).

Files Patch % Lines
ResSimpy/Nexus/NexusReporting.py 91.66% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@jonnyh404 jonnyh404 requested review from cflynn3 and kwr3 February 21, 2024 13:08
@jonnyh404 jonnyh404 marked this pull request as ready for review February 21, 2024 13:09
"""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
Copy link
Contributor

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.

Copy link
Collaborator Author

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:
Copy link
Contributor

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:
Copy link
Contributor

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]
Copy link
Contributor

Choose a reason for hiding this comment

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

nice list comprehension

Copy link
Contributor

@kwr3 kwr3 left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Collaborator

@cflynn3 cflynn3 left a 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.

@cflynn3 cflynn3 merged commit ade6b0e into master Feb 27, 2024
6 of 7 checks passed
@cflynn3 cflynn3 deleted the add_rft_to_files branch February 27, 2024 16:22
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants