Skip to content

Commit

Permalink
Merge pull request #264 from ajhynes7/fix_ci
Browse files Browse the repository at this point in the history
Set up Github Actions for releasing packages
  • Loading branch information
ajhynes7 committed Mar 21, 2021
2 parents 0679fa9 + 649da9a commit 236c853
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 19 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ jobs:
run: tox

- name: Upload coverage report to codecov
if: matrix.python-version == '3.9'
uses: codecov/codecov-action@v1.2.1
with:
fail_ci_if_error: true
verbose: true
gcov_prefix: ${{ env.GITHUB_WORKSPACE }}

- name: Build and publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
if: |
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags') &&
matrix.python-version == '3.9'
uses: JRubics/poetry-publish@v1
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
24 changes: 24 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
History
=======

6.0.0 (2021-03-21)
------------------

Breaking changes
~~~~~~~~~~~~~~~~
* Require NumPy >= 1.20 to make use of the static types introduced in 1.20.
Now numpy-stubs doesn't need to be installed for static type checking.
* Move tests outside of package, and move package under ``src`` directory.
This ensures that tox is running the tests with the installed package.
* Switch from ``setup.py`` to ``pyproject.toml``.
* Add more ValueErrors for clarity, such as "The lines must have the same dimension"
ValueError in ``Line.intersect_line``.

Features
~~~~~~~~
* Add ``Cylinder`` class.
* Add ``Vector.different_direction`` method.
* Add ``Sphere.best_fit`` method.

Refactoring
~~~~~~~~~~~
* Delete ``Vector.dot`` method. The ``dot`` method is already inherited from NumPy.


5.2.0 (2020-12-19)
------------------
* Add keyword arguments to ``Plane.best_fit`` and ``Line.best_fit``.
Expand Down
1 change: 1 addition & 0 deletions docs/source/api_reference/skspatial.objects.Vector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Methods
~skspatial.objects.Vector.angle_signed
~skspatial.objects.Vector.cosine_similarity
~skspatial.objects.Vector.cross
~skspatial.objects.Vector.different_direction
~skspatial.objects.Vector.from_points
~skspatial.objects.Vector.is_parallel
~skspatial.objects.Vector.is_perpendicular
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]

name = "scikit-spatial"
version = "5.2.0"
version = "6.0.0"
description = "Spatial objects and computations based on NumPy arrays."
license = "BSD"

Expand All @@ -15,7 +15,7 @@ documentation = "https://scikit-spatial.readthedocs.io"
keywords = ["NumPy", "matplotlib", "visualization", "spatial", "linear algebra"]

classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
Expand Down
2 changes: 1 addition & 1 deletion src/skspatial/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = "Andrew Hynes"
__email__ = 'andrewjhynes@gmail.com'
__version__ = '5.2.0'
__version__ = '6.0.0'
1 change: 1 addition & 0 deletions src/skspatial/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def _solve_quadratic(a: float, b: float, c: float, n_digits: int | None = None)
Raises
------
ValueError
If the coefficient `a` is zero.
If the discriminant is negative.
Examples
Expand Down
3 changes: 2 additions & 1 deletion src/skspatial/objects/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class Circle(_BaseSphere):
Raises
------
ValueError
If the radius is not positive, or if the point is not 2D.
If the radius is not positive.
If the point is not 2D.
Examples
--------
Expand Down
10 changes: 5 additions & 5 deletions src/skspatial/objects/cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class Cylinder(_BaseSpatial, _ToPointsMixin):
Raises
------
ValueError
If the point or vector are not 3D,
if the vector is all zeros,
or if the radius is zero.
If the point or vector are not 3D.
If the vector is all zeros.
If the radius is zero.
Examples
--------
Expand Down Expand Up @@ -279,8 +279,8 @@ def intersect_line(self, line: Line, n_digits: int | None = None) -> Tuple[Point
Raises
------
ValueError
If the line is not 3D,
or if it does not intersect the cylinder at one or two points.
If the line is not 3D.
If the line does not intersect the cylinder at one or two points.
References
----------
Expand Down
9 changes: 6 additions & 3 deletions src/skspatial/objects/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class Line(_BaseLinePlane):
Raises
------
ValueError
If the point and vector have different dimensions,
or if the vector is all zeros.
If the point and vector have different dimensions.
If the vector is all zeros.
Examples
--------
Expand Down Expand Up @@ -463,7 +463,10 @@ def intersect_line(self, other: 'Line', **kwargs) -> Point:
Raises
------
ValueError
If the lines are parallel or are not coplanar.
If the lines don't have the same dimension.
If the line dimension is greater than three.
If the lines are parallel.
If the lines are not coplanar.
References
----------
Expand Down
4 changes: 2 additions & 2 deletions src/skspatial/objects/plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class Plane(_BaseLinePlane, _ToPointsMixin):
Raises
------
ValueError
If the point and vector have different dimensions,
or if the vector is all zeros.
If the point and vector have different dimensions.
If the vector is all zeros.
Examples
--------
Expand Down
8 changes: 5 additions & 3 deletions src/skspatial/objects/sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class Sphere(_BaseSphere, _ToPointsMixin):
Raises
------
ValueError
If the radius is not positive, or if the point is not 3D.
If the radius is not positive.
If the point is not 3D.
Examples
--------
Expand Down Expand Up @@ -201,8 +202,9 @@ def best_fit(cls, points: array_like) -> Sphere:
Raises
------
ValueError
If the points are not 3D, if they lie in a plane,
or if there are fewer than four points.
If the points are not 3D.
If there are fewer than four points.
If the points lie in a plane.
Examples
--------
Expand Down
3 changes: 2 additions & 1 deletion src/skspatial/objects/triangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class Triangle(_BaseSpatial):
Raises
------
ValueError
If the points do not have the same dimension, or if they are collinear.
If the points do not have the same dimension.
If the points are collinear.
Examples
--------
Expand Down

0 comments on commit 236c853

Please sign in to comment.