Skip to content

Commit

Permalink
pre-commit run --all-files; fix errs and spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
rkingsbury committed Jul 31, 2023
1 parent 01d137e commit 4fc0057
Show file tree
Hide file tree
Showing 33 changed files with 419 additions and 914 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
rev: v0.0.280
hooks:
- id: ruff
args: [--fix, --ignore, D]
args: [--fix, --ignore, "D,E501"]

- repo: https://github.com/psf/black
rev: 23.7.0
Expand All @@ -39,3 +39,4 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
exclude: ".tsv"
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- Add more comprehensive platform testing via `tox`
- Replace `water_properties.py` with [iapws](https://github.com/jjgomera/iapws) package
- Replace elements.py with `pymatgen.core.periodic_table`
- Add `pymatgen` as a depedency
- Add `pymatgen` as a dependency
- Migrate all tests to `pytest`
- Add pre-commit configuration and lint with `black`
- Update packaging to use [pyscaffold](https://pyscaffold.org/en/stable/index.html)
Expand All @@ -32,7 +32,7 @@
- Added methods for calculating the osmolarity or osmolality of aSolution
- Add the ability to filter list_concentrations() to show onlycations or anions
- Add two medical solutions - normal saline and Ringer's lacate -to the autogenerate method
- Add shorthand abbreviations for 'seawater' and 'wastewater' inthe autogenerate method
- Add shorthand abbreviations for 'seawater' and 'wastewater' in the autogenerate method
- Enhance automatic test suite to compare results withexperimental data based on relative error
- Add test suites for the effective Pitzer model and amulticomponent salt solution
- DEPRECATED get_mole_fraction. Use get_amount() instead
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pyEQL is a Python library that provides tools for modeling aqueous electrolyte
solutions. It allows the user to manipulate solutions as Python
objects, providing methods to populate them with solutes, calculate
species-specific properties (such as activity and diffusion coefficients),
and retreive bulk properties (such as density, conductivity, or volume).
and retrieve bulk properties (such as density, conductivity, or volume).

![pyeql demo](pyeql-demo.png)

Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# serve to show the default.

import os
import sys
import shutil
import sys

# -- Path setup --------------------------------------------------------------

Expand Down Expand Up @@ -52,7 +52,7 @@

apidoc.main(args)
except Exception as e:
print("Running `sphinx-apidoc` failed!\n{}".format(e))
print(f"Running `sphinx-apidoc` failed!\n{e}")

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -114,7 +114,7 @@
#
# version: The short X.Y version.
# release: The full version, including alpha/beta/rc tags.
# If you dont need the separation provided between version and release,
# If you don`t need the separation provided between version and release,
# just set them both to the same value.
try:
from pyEQL import __version__ as version
Expand Down Expand Up @@ -301,4 +301,4 @@
"pyscaffold": ("https://pyscaffold.org/en/stable", None),
}

print(f"loading configurations for {project} {version} ...", file=sys.stderr)
print(f"loading configurations for {project} {version} ...", file=sys.stderr)
2 changes: 1 addition & 1 deletion docs/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ following parameters for some common electrolytes:
Basics
======

The Paramsdb class creates a container for parameters. Each paramter
The Paramsdb class creates a container for parameters. Each parameter
is an object which contains not only the value, but also information about
the units, the reference, and the conditions of measurement. paramsdb() also
defines several methods that are helpful for retrieving parameters.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Add a short description here!

> This is the main page of your project's [Sphinx] documentation. It is
> formatted in [Markdown]. Add additional pages by creating md-files in
> `docs` or rst-files (formated in [reStructuredText]) and adding links to
> `docs` or rst-files (formatted in [reStructuredText]) and adding links to
> them in the `Contents` section below.
>
> Please check [Sphinx], [recommonmark] and [autostructify] for more information
Expand Down
2 changes: 1 addition & 1 deletion examples/pyEQL_demo_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"<p style='margin-top:1em; text-align:center'>\n",
"<b>NOTICE</b></p>\n",
"<p style='margin-left:1em;'>\n",
"The example below is using a *development* version of `pyEQL`. There are some subtle differences compared to the relased version. Specifically:\n",
"The example below is using a *development* version of `pyEQL`. There are some subtle differences compared to the released version. Specifically:\n",
"\n",
"- The stable version does not support the `engine` keyword argument\n",
"- The stable version requires solutes to be input as list of lists rather than a dictionary\n",
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ line-length = 120
[tool.ruff]
target-version = "py37"
line-length = 120
exclude = ["src/pyEQL/parameter.py", "src/pyEQL/chemical_formula.py", "src/pyEQL/database.py"] # TODO - remove this line once files deprecated
exclude = ["src/pyEQL/parameter.py", "src/pyEQL/chemical_formula.py", "src/pyEQL/database.py", ".tsv"] # TODO - remove this line once files deprecated
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
Expand Down Expand Up @@ -84,5 +84,5 @@ explicit_package_bases = true
no_implicit_optional = false

[tool.codespell]
ignore-words-list = "ot,nin"
skip = 'docs/CHANGELOG.md,tests/test_files/*'
ignore-words-list = "nd"
skip = 'tests/test_files/*'
9 changes: 5 additions & 4 deletions src/pyEQL/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import sys

from pint import UnitRegistry
from pkg_resources import resource_filename

if sys.version_info[:2] >= (3, 8):
# TODO: Import directly (no need for conditional) when `python_requires = >= 3.8`
from importlib.metadata import PackageNotFoundError, version # pragma: no cover
Expand All @@ -26,8 +29,6 @@
:license: LGPL, see LICENSE for more details.
"""
from pint import UnitRegistry
from pkg_resources import resource_filename

# Units handling
# per the pint documentation, it's important that pint and its associated Unit
Expand All @@ -51,5 +52,5 @@
# initialize the parameters database
paramsDB = Paramsdb()

from pyEQL.functions import * # noqa: F401, E402, F403
from pyEQL.solution import Solution # noqa: F401, E402
from pyEQL.functions import * # noqa: E402, F403
from pyEQL.solution import Solution # noqa: E402
Loading

0 comments on commit 4fc0057

Please sign in to comment.