Skip to content
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

merge from sb_desal #89

Merged
merged 19 commits into from
Aug 30, 2024
Merged

merge from sb_desal #89

merged 19 commits into from
Aug 30, 2024

Conversation

LilyLiu0719
Copy link
Contributor

@LilyLiu0719 LilyLiu0719 commented Jun 19, 2024

Pull request recommendations:

  • Name your pull request your-development-type/short-description. Ex: feature/gui
  • Link to any relevant issue in the PR description. Ex: Resolves [ENH: Create GUI for easy user input #12]
  • Provide context of changes.
  • Provide relevant tests for your feature or bug fix.
  • Provide or update documentation for any feature added by your pull request.

Thanks for contributing!

Change:

  1. Added classes and features for desalination plant in node.py, ModularUnit, StaticMixer, ROMembrane, and UVSystem. Modify the corresponding functions in parse_json.py
  2. Added an extended network function extend_node in parse_json.py, which allow networks incorporates subnetwork into a node in a existing network
  3. Added an DosingType Enum class in utils.py for chemical dosing
  4. Added an check_type_compatibility function in tag.py to compare type.

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 86.80297% with 71 lines in your changes missing coverage. Please review.

Project coverage is 88.35%. Comparing base (7ccfce1) to head (bd2a3f8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pype_schema/node.py 87.80% 30 Missing ⚠️
pype_schema/connection.py 46.80% 25 Missing ⚠️
pype_schema/parse_json.py 92.59% 14 Missing ⚠️
pype_schema/tag.py 90.00% 1 Missing ⚠️
pype_schema/utils.py 96.42% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
- Coverage   88.92%   88.35%   -0.57%     
==========================================
  Files          16       16              
  Lines        2393     2895     +502     
==========================================
+ Hits         2128     2558     +430     
- Misses        265      337      +72     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@fletchapin fletchapin left a comment

Choose a reason for hiding this comment

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

Hi Lily! Sorry it took me so long to review but overall this looks good. The major remaining item (besides a couple small suggestions) would be to add tests for all the new classes. Since I'm assuming you're busy with your summer internship I'm happy to take care of that

@@ -2,7 +2,7 @@
from abc import ABC
from . import utils
from .tag import Tag, VirtualTag

from collections import defaultdict
Copy link
Contributor

Choose a reason for hiding this comment

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

I have never used defaultdict so thanks for teaching me something new!

Type of pump (either VFD or constant)
Type of pump (either VFD, ERI, AirBlower or constant)

efficiency : float
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if this efficiency is duplicative with the pump_curve which represents a similar concept. @LilyLiu0719 could you explain more what the ERI and the new efficiency terms are for exactly?

@@ -2943,6 +3382,12 @@ class Chlorination(Node):
volume : int
Volume of a single chlorinator in cubic meters

dosing_rate : dict of DosingType:float
Copy link
Contributor

Choose a reason for hiding this comment

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

Since UV is not chlorination, I would prefer creating a parent class Disinfection that includes both Chlorination and UVSystem to distinguish the types of disinfection

@@ -305,7 +331,7 @@ def __init__(

if determine_type:
if tag_type is not None:
if tag_type != tag.tag_type:
if not tag.check_type_compatibility(tag_type):
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe there is a bug in this logic. on L315 determine_type is only set to True if tag_type is None. This means that:

if determine_type:
    if tag_type is not None: 
        ...
    else:
        ...

is a tautology. I.e., you will always enter the else portion of the statement

@@ -491,6 +492,8 @@ class PumpType(Enum):

Constant = auto()
VFD = auto()
ERI = auto()
Copy link
Contributor

Choose a reason for hiding this comment

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

I am changing ERI to ERD (energy recovery device) throughout as I believe this is a typo. Let me know if that's incorrect in some way

verbose=False,
):
"""
Incoporates subnetwork (i.e. the `new_network`) into a node
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it is just the docstring, but the difference between merge_network and extend_node is not clear to me

@fletchapin fletchapin merged commit b75da60 into main Aug 30, 2024
2 of 4 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