Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

More fitting algorithms and type hints #10

Merged
merged 11 commits into from
Dec 17, 2022
Merged

More fitting algorithms and type hints #10

merged 11 commits into from
Dec 17, 2022

Conversation

nup002
Copy link
Collaborator

@nup002 nup002 commented Oct 27, 2022

This pull request extends the functionality of the circle-fits package by implementing 6 additional circle fitting algorithms based on MATLAB implementations by Nikolai Chernov.

- riemannSWFLa()  : Riemann circle fit, SWFL version A
- lm()            : Levenberg-Marquardt in the full (a,b,R) parameter space
- prattSVD()      : Algebraic circle fit by V. Pratt
- taubinSVD()     : Algebraic circle fit by G. Taubin
- hyperSVD()      : Algebraic circle fit with "hyperaccuracy"
- kmh()           : Consistent circle fit by A. Kukush, I. Markovsky, S. Van Huffel

Other enhancements:

  • Thorough type hinting of all functions
  • Detailed docstrings

Changes:

  • hyper_fit() has been renamed to hyperLSQ() to homogenize algorithm names
  • least_squares_circle() has been renamed to standardLSQ() to homogenize algorithm names
  • Calling hyper_fit() or least_squares_circle() will only raise a DeprecationWarning in order to not break backwards compatibility.

The new algorithms have been added to the demo notebook demo.ipynb and the unittests test.py.

Added a large collection of fitting algorithms.
Type hinted all code.
Reformatted all code.
Added docstrings to all functions.
Added numpy version requirement.
Doc changes to circle_fit.py.
Changed input variable format of plot_data_circle to match the fitting algorithms.
@nup002
Copy link
Collaborator Author

nup002 commented Nov 30, 2022

If nothing happens here @AlliedToasters I'll release circle-fits2.

@AlliedToasters
Copy link
Owner

hey @nup002 , thanks for all your contributions. I'd be happy to merge as long as I can add your contact info to the contributors list - due to the large number of changes, I won't be able to support the expanded codebase alone.. Is that ok with you?

@AlliedToasters
Copy link
Owner

@nup002 please fetch the latest README.md and add an email to the Contact section - once you do it, I can build and publish a new release with your changes!

@nup002
Copy link
Collaborator Author

nup002 commented Dec 17, 2022

Hi AlliedToaster, I am very happy to see you here! I was hoping I would not have to release a new circle-fit package.
I will add my contact information to the readme.

@AlliedToasters AlliedToasters merged commit 773256a into AlliedToasters:master Dec 17, 2022
@AlliedToasters
Copy link
Owner

@nup002 I am traveling today - once I am able to build and test the library, I will publish 0.2.0 to pypi! Thanks again for your contributions and I'm happy to have you here :)

@nup002
Copy link
Collaborator Author

nup002 commented Dec 17, 2022

@AlliedToasters Thank you for the invitation to collaborate on this repository! I am adding a few more commits, and then it should be ready for version 0.2.0.

Note that I have changed the build system from setup.py to pyproject.toml with hatchling, just like it is explained in the official documentation on packaging: https://packaging.python.org/en/latest/tutorials/packaging-projects/

I have also added GitHub Workflows for code style (flake8) and unittests (PyTest). Their results are displayed as badges in the ReadMe together with a few other badges.

I have tested that it builds and installs correctly.

@AlliedToasters
Copy link
Owner

@nup002 v0.2.0 has been released to pypi, thanks a lot for the help!!

@nup002
Copy link
Collaborator Author

nup002 commented Dec 20, 2022

You're welcome! Just a note on the new linting workflow I added, you can run flake8 in a command line terminal in the src directory before pushing to check if it will pass. I just noticed a lot of linting fix commits

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants