AguaClara / aguaclara

An open-source Python package for designing and performing research on AguaClara water treatment plants.
https://aguaclara.github.io/aguaclara/
MIT License
25 stars 13 forks source link

all273/pipes #289

Closed annabel48lin closed 3 years ago

annabel48lin commented 3 years ago

See Issue #279

  1. Created static methods to convert ID and SDR to the minimum available OD

    • OD_SDR: Return the minimum OD that is available given ID and SDR.
    • makePipe_minID_SDR(minID, SDR): Return a new pipe, given its minID (minimum inner diameter) and SDR (standard diameter ratio).
    • makePipe_ND_SDR(ND, SDR): Return a Pipe object, given a ND (nominal diameter) and SDR (standard diameter ratio). Same thing as directly creating a Pipe object, mainly for consistency with makePipe_minID_SDR.
  2. Standardized method and method parameter names.

  3. Wrote/added to documentations for methods and classes as needed.

  4. Used conditional indexing to make all_available methods more efficient.

    • The new method SCH_all_available can probably be made more efficient, if a future member would like to look at it.
  5. Asked Monroe if any other methods can be added to be more convenient to users:

    • Expanded pipe_database.csv to include SCH80, SCH120, SCH120.
    • Added class SCH(Enum)
    • Added Pipe.id_sch, which takes in a pipes.SCH and returns the inner diameter of the pipe based on the pipe's ND and the schedule passed in.
      • Added deprecation note to Pipe.id_sch40
    • Added Pipe.sch(self, NDarr, SCHarr): returns a nominal diameter and schedule that best fits the requirements of the pipe (i.e. has at least minID and has at most maxSDR), and whose ND and/or SCH are in NDarr and SCHarr respectively if provided.
    • Added SCH_all_available(minID, maxSDR, NDar, SCHarr): Return a list of tuples (nominal diameter, schedule) representing schedule pipes that fit the requirements (i.e. has at least minID and has at most maxSDR, and whose ND and/or SCH are in NDarr and SCHarr respectively if provided).
codecov[bot] commented 3 years ago

Codecov Report

Merging #289 (aba5ece) into master (43dbd56) will increase coverage by 0.20%. The diff coverage is 97.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #289      +/-   ##
==========================================
+ Coverage   89.35%   89.56%   +0.20%     
==========================================
  Files          29       29              
  Lines        2997     3047      +50     
==========================================
+ Hits         2678     2729      +51     
+ Misses        319      318       -1     
Impacted Files Coverage Δ
aguaclara/core/pipes.py 98.48% <97.53%> (+2.14%) :arrow_up:
aguaclara/design/floc.py 90.24% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 43dbd56...aba5ece. Read the comment docs.