Skip to content

Commit

Permalink
Packaging setup mark 1 (#1)
Browse files Browse the repository at this point in the history
* Added a gitignore file

* Updated version number

* Added docstring to __init__

* Added documentation

* Added index.html

* Reduced workflow
  • Loading branch information
williamjameshandley authored Jun 26, 2023
1 parent f65b8c8 commit e025d5f
Show file tree
Hide file tree
Showing 15 changed files with 419 additions and 63 deletions.
57 changes: 3 additions & 54 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,71 +52,20 @@ jobs:
make html SPHINXOPTS="-W --keep-going -n"
pip:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10']
extras: [true, false]
include:
- os: macos-latest
python-version: '3.10'
extras: true
- os: windows-latest
python-version: '3.10'
extras: true

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]"
- name: Install extra dependencies
if: ${{ matrix.extras }}
run: |
python -m pip install -e ".[all]"
- name: Test with pytest
run: python -m pytest --cov=unimpeded tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

conda:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10']
include:
- os: macos-latest
python-version: '3.10'
- os: windows-latest
python-version: '3.10'

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
shell: bash -l {0}
run: |
conda config --append channels conda-forge
conda install pytest pytest-cov
conda install scipy numpy 'matplotlib>=3.6.1' 'pandas>=2.0.0'
- name: Test with pytest
shell: bash -l {0}
run: python -m pytest --cov=unimpeded tests

- name: Upload coverage to Codecov
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
__pycache__
*.pyc
.eggs
.ipynb_checkpoints
dist
*.egg-info/
build
*~
.pytest_cache/*
.coverage
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Will Handley
Copyright (c) 2023 Will Handley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 13 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
==================================================================================
unimpeded: Universal model comparison & parameter estimation over diverse datasets
==================================================================================
:unimpeded: Universal model comparison & parameter estimation over diverse datasets
===========================================================================================
unimpeded: Universal model comparison & parameter estimation distributed over every dataset
===========================================================================================
:unimpeded: Universal model comparison & parameter estimation distributed over every dataset
:Author: Will Handley
:Version: 0.0.0
:Version: 0.0.1
:Homepage: https://github.com/handley-lab/unimpeded
:Documentation: http://unimpeded.readthedocs.io/

Expand Down Expand Up @@ -95,9 +95,15 @@ Full Documentation is hosted at `ReadTheDocs <http://unimpeded.readthedocs.io/>`

.. code:: bash
cd docs
make html
python -m pip install ".[all,docs]"
cd docs
make html
and view the documentation by opening ``docs/build/html/index.html`` in a browser. To regenerate the automatic RST files run:

.. code:: bash
sphinx-apidoc -fM -t docs/templates/ -o docs/source/ unimpeded/
Citation
--------
Expand Down
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
Loading

0 comments on commit e025d5f

Please sign in to comment.