himoto / hillfit

Fitting the Hill Equation to Experimental Data
MIT License
11 stars 4 forks source link

expand fitting.py, add an example Notebook, and create a setup.py file #3

Closed freiburgermsu closed 2 years ago

freiburgermsu commented 2 years ago

Hello!

I considerably expanded the functionality of Hillfit: e.g. simplified fitting.py logic, regression visualization and R^2 analysis, exportability of the regression, and customizability through module arguments. I also created an example Notebook that demonstrates these features, composed a professional RST README file, and published the module to PyPI (https://pypi.org/project/Hillfit/) aftering troubleshooting the setup.py file.

I included you as a co-author in the PyPI page. Do you have a PyPI account? I can list you formally as a contributor when you share your PyPI username.

I welcome your suggestions for an improved module :)

Thank you, Andrew

freiburgermsu commented 2 years ago

Hello @himoto!

1) A .gitignore file is created with your recommended contents, and is pushed to the repository. The existing directories that were blacklisted in the gitignore file were deleted from the repository as well. 2) I read that the essential difference between the MIT license and the GPL/GNU license is that the former authorizes profiteering while the latter does not. My inclination is to maintain free use of the module, and its derivatives, for greater public use; although, perhaps the licenses differ in other ways or perhaps a major use-case of the module would be in profitable software. I am open to learn and discuss the best option for Hillfit. 3) I removed the self from each function. The integration of syntax highlighting appears to be quite involved with CSS (http://futurile.net/2015/08/07/writing-highlighting-code-restructured-text/), and it may have only minimal benefits for the simple RST file; however, I indented function arguments to clarify the RST file.

I can expand the unit-test during next week, to capture more functions of the module, and then integrate it as a GitHub Action to streamline future edits of the fitting.py script.

Thank you :) Andrew

himoto commented 2 years ago

Hi @freiburgermsu , thank your for your detailed reply.

  1. Please remove hillfit/.ipynb_checkpoints as well.

  2. I read that the essential difference between the MIT license and the GPL/GNU license is that the former authorizes profiteering while the latter does not.

    If I understand right, the difference between these licenses are the latter is "copy left" license, so the derivative must comply with GPL. I am original developer of this package but now you are one of the major contributor, and I would like to respect your choice. Right now, releasing under the GPL is fine with me.

  3. Thanks for letting me know this. Is there any specific reason to use .rst format for README? If not, it would be nice to move to markdown in the future. Right now, it's totally fine.

Regarding the unit-test, currently you wrote requirements in intall_requirements in setup.py. If you move these to requirements.txt, i.e., create a file:

matplotlib
numpy
sklearn
scipy
pandas
sigfig

And update setup.py as followings:

# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from pathlib import Path

with open('README.rst', encoding='utf-8') as file:
    readme = file.read()

setup(
  name = 'Hillfit',    # By the way, I would prefer using "snake_case" for package name, i.e., hillfit
  package_dir = {'fitting':'hillfit'},
  packages = find_packages(),
  version = '0.0.5',
  license = 'GNU',
  description = "Model for fitting data with the Hill equation, and exporting the contents", 
  long_description = readme,
  author = 'Andrew Freiburger',               
  author_email = 'andrewfreiburger@gmail.com',
  url = 'https://github.com/freiburgermsu/hillfit',   
  keywords = ['biochemistry', 'systems biology', 'computational biology', 'data science', 'Hill equation'],
  install_requires = [l.strip() for l in Path("requirements.txt").read_text("utf-8").splitlines()]
)

Then, you can run tests via pytest. Please do let me know if you need help.

Again, your updates are amazing and I will merge it after passing all tests.

This is my PyPI account: https://pypi.org/user/himoto

freiburgermsu commented 2 years ago

Hello @himoto !

1) The checkpoint is deleted. 2) I changed the license to MIT, since I recognize now that GPL/GNU could greatly limit use of the module. 3) I used the RST format since it is specifically designed for API documentation (https://www.zverovich.net/2016/06/16/rst-vs-markdown.html), and thus has features beyond markdown: e.g. making complex tables and automatically generating documentation after importing a Python script. I will explore these features further to assess whether RST is actually preferential to markdown. a) I found a simpler means of syntax highlighting in RST, albeit with unconventional colors, which is updated on GitHub.

I composed an updated unit-test and successfully executed it via pytest with the current setup.py file; nevertheless, I will remember your suggestion. The unit-test is synchronized as a GitHub Action, where it executes with each push or PR.

I added your authorship to the hillfit PyPI project.

Thank you :) Andrew

himoto commented 2 years ago

Thanks, @freiburgermsu !