Skip to content

Commit

Permalink
Merge pull request #49 from chris-greening/refactor-object-locations
Browse files Browse the repository at this point in the history
Refactor objects into their own subpackages
  • Loading branch information
chris-greening authored Mar 18, 2023
2 parents 96eafa4 + 656f76a commit 82e1e97
Show file tree
Hide file tree
Showing 29 changed files with 137 additions and 48 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/pylint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Get Python changed files
id: changed-py-files
uses: tj-actions/changed-files@v23
with:
files: |
*.py
**/*.py
- name: Analysing the code with pylint
run: |
if: steps.changed-py-files.outputs.any_changed == 'true'
run: pylint ${{ steps.changed-py-files.outputs.all_changed_files }}
pylint $(git ls-files '*.py')
8 changes: 5 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configuration file for the Sphinx documentation builder.
"""Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
Expand All @@ -9,7 +9,9 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
"""
# pylint: disable=invalid-name,redefined-builtin

import os
import sys
sys.path.insert(0, os.path.abspath('..'))
Expand Down Expand Up @@ -65,4 +67,4 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

autodoc_default_flags = ['members', 'inherited-members']
autodoc_default_flags = ['members', 'inherited-members']
22 changes: 11 additions & 11 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ spyrograph is a lightweight Python package that provides an expressive and flexi

Hypotrochoid
------------
* :doc:`Hypotrochoid <source/spyrograph.hypotrochoid>`
* :doc:`Hypocycloid <source/spyrograph.hypocycloid>`
* :doc:`Ellipse <source/spyrograph.ellipse>`
* :doc:`Tusi couple <source/spyrograph.tusi_couple>`
* :doc:`Deltoid <source/spyrograph.deltoid>`
* :doc:`Astroid <source/spyrograph.astroid>`
* :doc:`Hypotrochoid <source/spyrograph.hypotrochoid.hypotrochoid>`
* :doc:`Hypocycloid <source/spyrograph.hypotrochoid.hypocycloid>`
* :doc:`Ellipse <source/spyrograph.hypotrochoid.ellipse>`
* :doc:`Tusi couple <source/spyrograph.hypotrochoid.tusi_couple>`
* :doc:`Deltoid <source/spyrograph.hypotrochoid.deltoid>`
* :doc:`Astroid <source/spyrograph.hypotrochoid.astroid>`

Epitrochoid
-----------
* :doc:`Epitrochoid <source/spyrograph.epitrochoid>`
* :doc:`Epicycloid <source/spyrograph.epicycloid>`
* :doc:`Cardioid <source/spyrograph.cardioid>`
* :doc:`Nephroid <source/spyrograph.nephroid>`
* :doc:`Ranuncloid <source/spyrograph.ranuncloid>`
* :doc:`Epitrochoid <source/spyrograph.epitrochoid.epitrochoid>`
* :doc:`Epicycloid <source/spyrograph.epitrochoid.epicycloid>`
* :doc:`Cardioid <source/spyrograph.epitrochoid.cardioid>`
* :doc:`Nephroid <source/spyrograph.epitrochoid.nephroid>`
* :doc:`Ranuncloid <source/spyrograph.epitrochoid.ranuncloid>`

Indices and tables
==================
Expand Down
8 changes: 8 additions & 0 deletions docs/source/spyrograph.epitrochoid.cardioid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.epitrochoid.cardioid module
======================================

.. automodule:: spyrograph.epitrochoid.cardioid
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.epitrochoid.epicycloid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.epitrochoid.epicycloid module
========================================

.. automodule:: spyrograph.epitrochoid.epicycloid
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.epitrochoid.epitrochoid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.epitrochoid.epitrochoid module
=========================================

.. automodule:: spyrograph.epitrochoid.epitrochoid
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.epitrochoid.nephroid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.epitrochoid.nephroid module
======================================

.. automodule:: spyrograph.epitrochoid.nephroid
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.epitrochoid.ranuncloid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.epitrochoid.ranuncloid module
========================================

.. automodule:: spyrograph.epitrochoid.ranuncloid
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.hypotrochoid.astroid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.hypotrochoid.astroid module
======================================

.. automodule:: spyrograph.hypotrochoid.astroid
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.hypotrochoid.deltoid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.hypotrochoid.deltoid module
======================================

.. automodule:: spyrograph.hypotrochoid.deltoid
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.hypotrochoid.ellipse.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.hypotrochoid.ellipse module
======================================

.. automodule:: spyrograph.hypotrochoid.ellipse
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.hypotrochoid.hypocycloid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.hypotrochoid.hypocycloid module
==========================================

.. automodule:: spyrograph.hypotrochoid.hypocycloid
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.hypotrochoid.hypotrochoid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.hypotrochoid.hypotrochoid module
===========================================

.. automodule:: spyrograph.hypotrochoid.hypotrochoid
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/source/spyrograph.hypotrochoid.tusi_couple.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spyrograph.hypotrochoid.tusi\_couple module
===========================================

.. automodule:: spyrograph.hypotrochoid.tusi_couple
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
"""Setup script for publishing package to PyPI"""

import setuptools

with open("README.md", "r") as fh:
with open("README.md", "r", encoding='UTF-8') as fh:
long_description = fh.read()

setuptools.setup(
name="spyrograph",
version="0.11.2",
version="0.11.3",
author="Chris Greening",
author_email="chris@christophergreening.com",
description="Library for drawing spirographs in Python",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/chris-greening/spyrograph",
packages=[],
packages=setuptools.find_packages(),
install_requires=[],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.7",
)
)
14 changes: 2 additions & 12 deletions spyrograph/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
"""Import top-level API"""

from spyrograph.hypotrochoid import Hypotrochoid
from spyrograph.epitrochoid import Epitrochoid
from spyrograph.hypocycloid import Hypocycloid
from spyrograph.epicycloid import Epicycloid
from spyrograph.deltoid import Deltoid
from spyrograph.astroid import Astroid
from spyrograph.ellipse import Ellipse
from spyrograph.tusi_couple import TusiCouple
from spyrograph.cardioid import Cardioid
from spyrograph.nephroid import Nephroid
from spyrograph.ranuncloid import Ranuncloid
from spyrograph.hypotrochoid import *
from spyrograph.epitrochoid import *
7 changes: 7 additions & 0 deletions spyrograph/epitrochoid/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Import all epitrochoids into toplevel API for easy importing"""

from spyrograph.epitrochoid.epitrochoid import Epitrochoid
from spyrograph.epitrochoid.epicycloid import Epicycloid
from spyrograph.epitrochoid.cardioid import Cardioid
from spyrograph.epitrochoid.nephroid import Nephroid
from spyrograph.epitrochoid.ranuncloid import Ranuncloid
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List
from numbers import Number

from spyrograph.epicycloid import Epicycloid
from spyrograph.epitrochoid.epicycloid import Epicycloid

class Cardioid(Epicycloid):
"""Model of a cardioid which is a special case of an epicycloid where the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List
from numbers import Number

from spyrograph.epitrochoid import Epitrochoid
from spyrograph.epitrochoid.epitrochoid import Epitrochoid

class Epicycloid(Epitrochoid):
"""Model of a epicycloid which is a special case of a epitrochoid where the
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List
from numbers import Number

from spyrograph.epicycloid import Epicycloid
from spyrograph.epitrochoid.epicycloid import Epicycloid

class Nephroid(Epicycloid):
"""Model of a nephroid which is a special case of an epicycloid where the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List
from numbers import Number

from spyrograph.epicycloid import Epicycloid
from spyrograph.epitrochoid.epicycloid import Epicycloid

class Ranuncloid(Epicycloid):
"""Model of a ranuncloid which is a special case of an epicycloid where the
Expand Down
8 changes: 8 additions & 0 deletions spyrograph/hypotrochoid/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Import all epitrochoids into toplevel API for easy importing"""

from spyrograph.hypotrochoid.hypotrochoid import Hypotrochoid
from spyrograph.hypotrochoid.hypocycloid import Hypocycloid
from spyrograph.hypotrochoid.deltoid import Deltoid
from spyrograph.hypotrochoid.astroid import Astroid
from spyrograph.hypotrochoid.ellipse import Ellipse
from spyrograph.hypotrochoid.tusi_couple import TusiCouple
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numbers import Number
from typing import List

from spyrograph.hypocycloid import Hypocycloid
from spyrograph.hypotrochoid.hypocycloid import Hypocycloid

class Astroid(Hypocycloid):
"""Model of an astroid which is a special case of a hypocycloid where the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numbers import Number
from typing import List

from spyrograph.hypocycloid import Hypocycloid
from spyrograph.hypotrochoid.hypocycloid import Hypocycloid

class Deltoid(Hypocycloid):
"""Model of a deltoid which is a special case of a hypocycloid where the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from numbers import Number
from typing import List

from spyrograph.hypotrochoid import Hypotrochoid
from spyrograph.hypotrochoid.hypotrochoid import Hypotrochoid

class Ellipse(Hypotrochoid):
"""Model of an ellipse which is a special case of a hypotrochoid where the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List
from numbers import Number

from spyrograph.hypotrochoid import Hypotrochoid
from spyrograph.hypotrochoid.hypotrochoid import Hypotrochoid

class Hypocycloid(Hypotrochoid):
"""Model of a hypocycloid which is a special case of a hypotrochoid where
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numbers import Number
from typing import List

from spyrograph.hypotrochoid import Hypotrochoid
from spyrograph.hypotrochoid.hypotrochoid import Hypotrochoid

class TusiCouple(Hypotrochoid):
"""Model of a Tusi couple which is a special case of a hypotrochoid where
Expand Down

0 comments on commit 82e1e97

Please sign in to comment.