Skip to content

Commit

Permalink
hotfix: import error (#324)
Browse files Browse the repository at this point in the history
* Fixed import error

* All tests passing!

* Hopefully I fixed the CI errors

* hopefully fixed docs error

* More updates to reqs

* maybe this wil do it?

* Fixing build.yml

* Fixing broken links

* Missed one http link

* trying something else to fix build error

* Fixing duplicate runs of build workflow

* Trying to fix codecov error

* Fixing syntax
  • Loading branch information
fletchapin authored Feb 8, 2023
1 parent cc40815 commit 4760537
Show file tree
Hide file tree
Showing 13 changed files with 1,424 additions and 765 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build

on: [push, pull_request]
on:
pull_request:
push:
branches:
- main

jobs:
test-python:
Expand All @@ -24,14 +28,14 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev
pipenv install --dev --python ${{ matrix.python-version }}
- name: Run pytests and generate coverage report
run: |
pipenv run pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true

Expand Down Expand Up @@ -62,4 +66,4 @@ jobs:
uses: chabad360/htmlproofer@master
with:
directory: docs/build/html
arguments: --allow_hash_href --file_ignore "docs/build/html/search.html"
arguments: --allow_hash_href --ignore-files "docs/build/html/search.html"
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ pint = "*"
pandas = "*"
scipy = "*"
onshape_client = "*"
numpy = "==1.22.1"

[dev-packages]
aguaclara = {editable = true, path = "."}
autopep8 = "*"
codecov = "*"
coverage = "*"
pylint = "*"
pytest = "*"
pytest = "==7.2.1"
pytest-cov = "*"
pytest-runner = "*"
atomicwrites = {version = ">=1.0", sys.platform = "win32"} # pytest dependency
Expand Down
2,136 changes: 1,399 additions & 737 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aguaclara/core/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def ac_hash(hashable_object):
a_hash = repr(hashable_object)
elif isinstance(hashable_object, HashableObject):
a_hash = hashable_object.ac_hash()
elif isinstance(hashable_object, collections.Iterable):
elif isinstance(hashable_object, collections.abc.Iterable):
a_hash = ac_hash_iterable_into_tuple(hashable_object)
else:
a_hash = repr(hashable_object)
Expand Down
4 changes: 2 additions & 2 deletions aguaclara/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
#: The ratio of maximum energy dissipation rate in a round jet to the kinetic
#: energy per time required for the jet to travel a distance equal to its
#: diameter. See `round jet
#: <https://aguaclara.github.io/Textbook/Rapid_Mix/RM_Derivations.html?#round-jet>`_
#: <https://aguaclara.github.io/Textbook/Fluid_Deformation_and_Energy_Dissipation/FDED_Derivations.html?#round-jet>`_
#: in the AguaClara textbook for more details.
JET_ROUND_RATIO = 0.08

#: The ratio of maximum energy dissipation rate in a plane jet to the kinetic
#: energy per time required for the jet to travel a distance equal to its
#: diameter. This ratio applies to jets in the flocculator and sedimentation
#: tank. See `plane jet
#: <https://aguaclara.github.io/Textbook/Rapid_Mix/RM_Derivations.html?#plane-jet>`_
#: <https://aguaclara.github.io/Textbook/Fluid_Deformation_and_Energy_Dissipation/FDED_Derivations.html#plane-jet>`_
#: in the AguaClara textbook for more details.
JET_PLANE_RATIO = 0.0124

Expand Down
10 changes: 0 additions & 10 deletions aguaclara/core/data/unit_definitions.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
"""
Created on Fri June 23 2017

Author: Sage Weber-Shirk

Last modified: Mon Jun 26 2017
By: Sage Weber-Shirk

"""

NTU = 1.47 * (mg / L)
dollar = [money] = USD
lempira = dollar * 0.0427 = HNL
Expand Down
2 changes: 1 addition & 1 deletion aguaclara/core/pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Note:
added to pipe database for schedule 80, 120 and 160 using
https://www.engineersedge.com/pipe_schedules.htm#Related
https://www.engineersedge.com/pipe_schedules.htm
"""

from aguaclara.core.units import u
Expand Down
5 changes: 3 additions & 2 deletions aguaclara/core/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@
u.default_format = '.4g'
pd.options.display.float_format = '{:,.4g}'.format

u.load_definitions(os.path.join(os.path.dirname(__file__),
"data", "unit_definitions.txt"))
u.load_definitions(
os.path.join(os.path.dirname(__file__), "data", "unit_definitions.txt")
)


def set_sig_figs(n=4):
Expand Down
6 changes: 3 additions & 3 deletions aguaclara/design/floc.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ def chan_n(self):
) + self.ent_l
) / self.chan_l).to_base_units()

if self.chan_n_parity is 'even':
if self.chan_n_parity == 'even':
return ut.ceil_step(chan_n, step=2)
elif self.chan_n_parity is 'odd':
elif self.chan_n_parity == 'odd':
return ut.ceil_step(chan_n, step=2) - 1
elif self.chan_n_parity is 'any':
elif self.chan_n_parity == 'any':
return ut.ceil_step(chan_n, step=1)

@property
Expand Down
2 changes: 1 addition & 1 deletion aguaclara/research/peristaltic_pump.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def vol_per_rev_3_stop(color="", inner_diameter=0):
"""Return the volume per revolution of an Ismatec 6 roller pump
given the inner diameter (ID) of 3-stop tubing. The calculation is
interpolated from the table found at
http://www.ismatec.com/int_e/pumps/t_mini_s_ms_ca/tubing_msca2.htm.
https://web.archive.org/web/20211027155239/http://www.ismatec.com/int_e/pumps/t_mini_s_ms_ca/tubing_msca2.htm.
Note:
1. Either input a string as the tubing color code or a number as the
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@
todo_include_todos = True

def setup(app):
app.add_stylesheet("css/youtube.css")
app.add_css_file("css/youtube.css")
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Welcome to the AguaClara Package Documentation!
.. |ACR| image:: images/acr_logo.png
:width: 250 px

``aguaclara`` is a Python package developed by `AguaClara Cornell <http://aguaclara.cornell.edu/>`_ and `AguaClara Reach <https://www.aguaclarareach.org/>`_ for designing and performing research on AguaClara water treatment plants. The package has several main functionalities:
``aguaclara`` is a Python package developed by `AguaClara Cornell <https://aguaclara.cornell.edu/>`_ and `AguaClara Reach <https://www.aguaclarareach.org/>`_ for designing and performing research on AguaClara water treatment plants. The package has several main functionalities:

* **DESIGN** of AguaClara water treatment plant components
* **MODELING** of physical, chemical, and hydraulic processes in water treatment
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
'pandas',
'scipy',
'onshape_client',
'numpy==1.22.1'
],

python_requires='>=3.8',
setup_requires=["pytest-runner"],
tests_require=["pytest"],
tests_require=["pytest==7.2.1"],
include_package_data=True,
test_suite="tests",
zip_safe=False
Expand Down

0 comments on commit 4760537

Please sign in to comment.