From f61b8170b24aae74dfbb1e8a59903b60daa78407 Mon Sep 17 00:00:00 2001 From: Peng Zheng Date: Mon, 7 Aug 2023 10:51:48 +0800 Subject: [PATCH] Update Installation instruction (#24) * update installation instruction * update badges * update license and build instruction --- .github/workflows/python-build.yml | 6 ++-- LICENSE | 2 +- README.rst | 28 ++++++++++------ pyproject.toml | 28 ++++++++++++++++ setup.py | 52 ------------------------------ src/limetr/__about__.py | 16 --------- 6 files changed, 50 insertions(+), 82 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py delete mode 100644 src/limetr/__about__.py diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 855040b..d52c193 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -7,12 +7,12 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.10" - name: Install dependencies - run: python -m pip install .[dev] --upgrade pip + run: python -m pip install .[test] --upgrade pip - name: Test with pytest run: pytest - name: Build package distribution diff --git a/LICENSE b/LICENSE index 6b7ec3a..aeaebd8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 2-Clause License -Copyright (c) 2021, Peng Zheng +Copyright (c) 2023, IHME Math Sciences All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.rst b/README.rst index 626465b..8fe02b9 100644 --- a/README.rst +++ b/README.rst @@ -1,23 +1,31 @@ -.. image:: https://github.com/zhengp0/limetr/workflows/python-build/badge.svg +.. image:: https://img.shields.io/pypi/l/limetr + :target: https://github.com/zhengp0/limetr/blob/main/LICENSE + +.. image:: https://img.shields.io/pypi/v/limetr + :target: https://pypi.org/project/limetr + +.. image:: https://img.shields.io/github/actions/workflow/status/zhengp0/limetr/python-build.yml?branch=main :target: https://github.com/zhengp0/limetr/actions LimeTr ====== -:code:`limetr`, read as "lime tree", is a Python package solves mixed effects models with linear random effects. +``limetr``, read as "lime tree", is a Python package solves mixed effects models with linear random effects. Moreover the package also provides robust regression option called "trimming". -Install -------- +Installation +------------ -The package can be installed through ``pip``, +``limetr>=0.1.0`` requires python 3.10 or higher, it can be install via -.. code-block:: bash +.. code:: bash - pip install limetr + pip install limetr>=0.1.0 -Or you could install from source, by clone this repository and do, +For developers, you can clone the repository and install the package in the development mode. -.. code-block:: bash +.. code:: bash - python setup.py install + git clone https://kgithub.com/zhengp0/xspline.git + cd xspline + pip install -e ".[test,docs]" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9b03839 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "limetr" +version = "0.1.1" +description = "Robust linear mixed effects model" +readme = "REDME.rst" +requires-python = ">=3.10" +license = { file = "LICENSE" } +authors = [ + { name = "IHME Math Sciences", email = "ihme.math.sciences@gmail.com" }, +] +dependencies = ["numpy>=1.25.1", "scipy>=1.11.1", "matplotlib>=3.7.2", "spmat<0.1.0"] + +[project.optional-dependencies] +test = ["pytest", "pytest-cov"] +docs = ["sphinx", "sphinx-autodoc-typehints", "furo"] + +[project.urls] +github = "https://github.com/zhengp0/limetr" + +[tool.sphinx] +project = "limetr" +author = "IHME Math Sciences" +copyright = "2023, IHME Math Sciences" +version = "0.1.1" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 1ae2eb2..0000000 --- a/setup.py +++ /dev/null @@ -1,52 +0,0 @@ -import sys -from pathlib import Path -from setuptools import setup, find_packages - - -if __name__ == '__main__': - base_dir = Path(__file__).parent - src_dir = base_dir/'src'/'limetr' - - sys.path.insert(0, src_dir.as_posix()) - import __about__ as about - - with (base_dir/'README.rst').open() as f: - long_description = f.read() - - install_requirements = [ - 'numpy', - 'scipy', - 'spmat', - 'matplotlib' - ] - - test_requirements = [ - 'pytest', - 'pytest-mock', - ] - - doc_requirements = [] - - setup(name=about.__title__, - version=about.__version__, - - description=about.__summary__, - long_description=long_description, - license=about.__license__, - url=about.__uri__, - - author=about.__author__, - author_email=about.__email__, - - package_dir={'': 'src'}, - packages=find_packages(where='src'), - include_package_data=True, - - install_requires=install_requirements, - tests_require=test_requirements, - extras_require={ - 'docs': doc_requirements, - 'test': test_requirements, - 'dev': doc_requirements + test_requirements - }, - zip_safe=False,) diff --git a/src/limetr/__about__.py b/src/limetr/__about__.py deleted file mode 100644 index 6ec36bb..0000000 --- a/src/limetr/__about__.py +++ /dev/null @@ -1,16 +0,0 @@ -__all__ = [ - "__title__", "__summary__", "__uri__", "__version__", "__author__", - "__email__", "__license__", "__copyright__", -] - -__title__ = "limetr" -__summary__ = "limetr: linear mixed effects model with trimming." -__uri__ = "https://github.com/zhengp0/limetr" - -__version__ = "0.1.1" - -__author__ = "Peng Zheng" -__email__ = "zhengp@uw.eud" - -__license__ = "MIT License" -__copyright__ = f"Copyright 2020 {__author__}"