From 0c74976fbcda5c7bd1949fdbb103efb71fc416cf Mon Sep 17 00:00:00 2001 From: scottyang <67733409+scott-yj-yang@users.noreply.github.com> Date: Mon, 10 Apr 2023 14:37:57 -0700 Subject: [PATCH] initial commits --- .github/workflows/deploy.yaml | 14 +++++ .github/workflows/test.yaml | 7 +++ CanvasGroupy/__init__.py | 1 + CanvasGroupy/_modidx.py | 8 +++ CanvasGroupy/core.py | 7 +++ MANIFEST.in | 5 ++ README.md | 22 ++++++- _proc/.gitignore | 1 + _proc/00_core.ipynb | 73 +++++++++++++++++++++++ _proc/_docs/index.html | 8 +++ _proc/_docs/robots.txt | 1 + _proc/_docs/sitemap.xml | 3 + _proc/_quarto.yml | 20 +++++++ _proc/index.ipynb | 108 ++++++++++++++++++++++++++++++++++ _proc/nbdev.yml | 9 +++ _proc/styles.css | 37 ++++++++++++ nbs/00_core.ipynb | 61 +++++++++++++++++++ nbs/_quarto.yml | 20 +++++++ nbs/index.ipynb | 96 ++++++++++++++++++++++++++++++ nbs/nbdev.yml | 9 +++ nbs/styles.css | 37 ++++++++++++ settings.ini | 43 ++++++++++++++ setup.py | 57 ++++++++++++++++++ 23 files changed, 646 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/test.yaml create mode 100644 CanvasGroupy/__init__.py create mode 100644 CanvasGroupy/_modidx.py create mode 100644 CanvasGroupy/core.py create mode 100644 MANIFEST.in create mode 100644 _proc/.gitignore create mode 100644 _proc/00_core.ipynb create mode 100644 _proc/_docs/index.html create mode 100644 _proc/_docs/robots.txt create mode 100644 _proc/_docs/sitemap.xml create mode 100644 _proc/_quarto.yml create mode 100644 _proc/index.ipynb create mode 100644 _proc/nbdev.yml create mode 100644 _proc/styles.css create mode 100644 nbs/00_core.ipynb create mode 100644 nbs/_quarto.yml create mode 100644 nbs/index.ipynb create mode 100644 nbs/nbdev.yml create mode 100644 nbs/styles.css create mode 100644 settings.ini create mode 100644 setup.py diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..29bfc57 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,14 @@ +name: Deploy to GitHub Pages + +permissions: + contents: write + pages: write + +on: + push: + branches: [ "main", "master" ] + workflow_dispatch: +jobs: + deploy: + runs-on: ubuntu-latest + steps: [uses: fastai/workflows/quarto-ghp@master] diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..5608592 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,7 @@ +name: CI +on: [workflow_dispatch, pull_request, push] + +jobs: + test: + runs-on: ubuntu-latest + steps: [uses: fastai/workflows/nbdev-ci@master] diff --git a/CanvasGroupy/__init__.py b/CanvasGroupy/__init__.py new file mode 100644 index 0000000..f102a9c --- /dev/null +++ b/CanvasGroupy/__init__.py @@ -0,0 +1 @@ +__version__ = "0.0.1" diff --git a/CanvasGroupy/_modidx.py b/CanvasGroupy/_modidx.py new file mode 100644 index 0000000..1451ade --- /dev/null +++ b/CanvasGroupy/_modidx.py @@ -0,0 +1,8 @@ +# Autogenerated by nbdev + +d = { 'settings': { 'branch': 'main', + 'doc_baseurl': '/CanvasGroupy', + 'doc_host': 'https://FleischerResearchLab.github.io', + 'git_url': 'https://github.com/FleischerResearchLab/CanvasGroupy', + 'lib_path': 'CanvasGroupy'}, + 'syms': {'CanvasGroupy.core': {'CanvasGroupy.core.foo': ('core.html#foo', 'CanvasGroupy/core.py')}}} diff --git a/CanvasGroupy/core.py b/CanvasGroupy/core.py new file mode 100644 index 0000000..6552cc5 --- /dev/null +++ b/CanvasGroupy/core.py @@ -0,0 +1,7 @@ +# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_core.ipynb. + +# %% auto 0 +__all__ = ['foo'] + +# %% ../nbs/00_core.ipynb 3 +def foo(): pass diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..5c0e7ce --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include settings.ini +include LICENSE +include CONTRIBUTING.md +include README.md +recursive-exclude * __pycache__ diff --git a/README.md b/README.md index be374f3..a4de150 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # CanvasGroupy -Canvas Grouping Python Script + + + +This file will become your README and also the index of your +documentation. + +## Install + +``` sh +pip install CanvasGroupy +``` + +## How to use + +Fill me in please! Don’t forget code examples: + +``` python +1+1 +``` + + 2 diff --git a/_proc/.gitignore b/_proc/.gitignore new file mode 100644 index 0000000..075b254 --- /dev/null +++ b/_proc/.gitignore @@ -0,0 +1 @@ +/.quarto/ diff --git a/_proc/00_core.ipynb b/_proc/00_core.ipynb new file mode 100644 index 0000000..1ba800a --- /dev/null +++ b/_proc/00_core.ipynb @@ -0,0 +1,73 @@ +{ + "cells": [ + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "---\n", + "description: Fill in a module description here\n", + "output-file: core.html\n", + "title: core\n", + "\n", + "---\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "---\n", + "\n", + "### foo\n", + "\n", + "> foo ()" + ], + "text/plain": [ + "---\n", + "\n", + "### foo\n", + "\n", + "> foo ()" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#| echo: false\n", + "#| output: asis\n", + "show_doc(foo)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/_proc/_docs/index.html b/_proc/_docs/index.html new file mode 100644 index 0000000..64f21e3 --- /dev/null +++ b/_proc/_docs/index.html @@ -0,0 +1,8 @@ + + + Redirect to core.html + + + + + diff --git a/_proc/_docs/robots.txt b/_proc/_docs/robots.txt new file mode 100644 index 0000000..60c5df7 --- /dev/null +++ b/_proc/_docs/robots.txt @@ -0,0 +1 @@ +Sitemap: https://FleischerResearchLab.github.io/CanvasGroupy/sitemap.xml diff --git a/_proc/_docs/sitemap.xml b/_proc/_docs/sitemap.xml new file mode 100644 index 0000000..7962ef4 --- /dev/null +++ b/_proc/_docs/sitemap.xml @@ -0,0 +1,3 @@ + + + diff --git a/_proc/_quarto.yml b/_proc/_quarto.yml new file mode 100644 index 0000000..0a6dfcb --- /dev/null +++ b/_proc/_quarto.yml @@ -0,0 +1,20 @@ +project: + type: website + +format: + html: + theme: cosmo + css: styles.css + toc: true + +website: + twitter-card: true + open-graph: true + repo-actions: [issue] + navbar: + background: primary + search: true + sidebar: + style: floating + +metadata-files: [nbdev.yml, sidebar.yml] \ No newline at end of file diff --git a/_proc/index.ipynb b/_proc/index.ipynb new file mode 100644 index 0000000..67ca2f4 --- /dev/null +++ b/_proc/index.ipynb @@ -0,0 +1,108 @@ +{ + "cells": [ + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "---\n", + "description: Canvas Grouping Python Script\n", + "output-file: index.html\n", + "title: CanvasGroupy\n", + "\n", + "---\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This file will become your README and also the index of your documentation." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Install" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```sh\n", + "pip install CanvasGroupy\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## How to use" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Fill me in please! Don't forget code examples:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "language": "python" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": null, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1+1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "language": "python" + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/_proc/nbdev.yml b/_proc/nbdev.yml new file mode 100644 index 0000000..2c6d459 --- /dev/null +++ b/_proc/nbdev.yml @@ -0,0 +1,9 @@ +project: + output-dir: _docs + +website: + title: "CanvasGroupy" + site-url: "https://FleischerResearchLab.github.io/CanvasGroupy" + description: "Canvas Grouping Python Script" + repo-branch: main + repo-url: "https://github.com/FleischerResearchLab/CanvasGroupy" diff --git a/_proc/styles.css b/_proc/styles.css new file mode 100644 index 0000000..66ccc49 --- /dev/null +++ b/_proc/styles.css @@ -0,0 +1,37 @@ +.cell { + margin-bottom: 1rem; +} + +.cell > .sourceCode { + margin-bottom: 0; +} + +.cell-output > pre { + margin-bottom: 0; +} + +.cell-output > pre, .cell-output > .sourceCode > pre, .cell-output-stdout > pre { + margin-left: 0.8rem; + margin-top: 0; + background: none; + border-left: 2px solid lightsalmon; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.cell-output > .sourceCode { + border: none; +} + +.cell-output > .sourceCode { + background: none; + margin-top: 0; +} + +div.description { + padding-left: 2px; + padding-top: 5px; + font-style: italic; + font-size: 135%; + opacity: 70%; +} diff --git a/nbs/00_core.ipynb b/nbs/00_core.ipynb new file mode 100644 index 0000000..9c081f5 --- /dev/null +++ b/nbs/00_core.ipynb @@ -0,0 +1,61 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# core\n", + "\n", + "> Fill in a module description here" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#| default_exp core" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#| hide\n", + "from nbdev.showdoc import *" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#| export\n", + "def foo(): pass" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#| hide\n", + "import nbdev; nbdev.nbdev_export()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/nbs/_quarto.yml b/nbs/_quarto.yml new file mode 100644 index 0000000..0a6dfcb --- /dev/null +++ b/nbs/_quarto.yml @@ -0,0 +1,20 @@ +project: + type: website + +format: + html: + theme: cosmo + css: styles.css + toc: true + +website: + twitter-card: true + open-graph: true + repo-actions: [issue] + navbar: + background: primary + search: true + sidebar: + style: floating + +metadata-files: [nbdev.yml, sidebar.yml] \ No newline at end of file diff --git a/nbs/index.ipynb b/nbs/index.ipynb new file mode 100644 index 0000000..bce7784 --- /dev/null +++ b/nbs/index.ipynb @@ -0,0 +1,96 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#| hide\n", + "from CanvasGroupy.core import *" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CanvasGroupy\n", + "\n", + "> Canvas Grouping Python Script" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This file will become your README and also the index of your documentation." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Install" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "```sh\n", + "pip install CanvasGroupy\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## How to use" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Fill me in please! Don't forget code examples:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": null, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1+1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/nbs/nbdev.yml b/nbs/nbdev.yml new file mode 100644 index 0000000..2c6d459 --- /dev/null +++ b/nbs/nbdev.yml @@ -0,0 +1,9 @@ +project: + output-dir: _docs + +website: + title: "CanvasGroupy" + site-url: "https://FleischerResearchLab.github.io/CanvasGroupy" + description: "Canvas Grouping Python Script" + repo-branch: main + repo-url: "https://github.com/FleischerResearchLab/CanvasGroupy" diff --git a/nbs/styles.css b/nbs/styles.css new file mode 100644 index 0000000..66ccc49 --- /dev/null +++ b/nbs/styles.css @@ -0,0 +1,37 @@ +.cell { + margin-bottom: 1rem; +} + +.cell > .sourceCode { + margin-bottom: 0; +} + +.cell-output > pre { + margin-bottom: 0; +} + +.cell-output > pre, .cell-output > .sourceCode > pre, .cell-output-stdout > pre { + margin-left: 0.8rem; + margin-top: 0; + background: none; + border-left: 2px solid lightsalmon; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.cell-output > .sourceCode { + border: none; +} + +.cell-output > .sourceCode { + background: none; + margin-top: 0; +} + +div.description { + padding-left: 2px; + padding-top: 5px; + font-style: italic; + font-size: 135%; + opacity: 70%; +} diff --git a/settings.ini b/settings.ini new file mode 100644 index 0000000..b5eebd8 --- /dev/null +++ b/settings.ini @@ -0,0 +1,43 @@ +[DEFAULT] +# All sections below are required unless otherwise specified. +# See https://github.com/fastai/nbdev/blob/master/settings.ini for examples. + +### Python library ### +repo = CanvasGroupy +lib_name = %(repo)s +version = 0.0.1 +min_python = 3.7 +license = apache2 +black_formatting = False + +### nbdev ### +doc_path = _docs +lib_path = CanvasGroupy +nbs_path = nbs +recursive = True +tst_flags = notest +put_version_in_init = True + +### Docs ### +branch = main +custom_sidebar = False +doc_host = https://%(user)s.github.io +doc_baseurl = /%(repo)s +git_url = https://github.com/%(user)s/%(repo)s +title = %(lib_name)s + +### PyPI ### +audience = Developers +author = scottyang +author_email = 67733409+scott-yj-yang@users.noreply.github.com +copyright = 2023 onwards, %(author)s +description = Canvas Grouping Python Script +keywords = nbdev jupyter notebook python +language = English +status = 3 +user = FleischerResearchLab + +### Optional ### +# requirements = fastcore pandas +# dev_requirements = +# console_scripts = \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..34abbe8 --- /dev/null +++ b/setup.py @@ -0,0 +1,57 @@ +from pkg_resources import parse_version +from configparser import ConfigParser +import setuptools, shlex +assert parse_version(setuptools.__version__)>=parse_version('36.2') + +# note: all settings are in settings.ini; edit there, not here +config = ConfigParser(delimiters=['=']) +config.read('settings.ini') +cfg = config['DEFAULT'] + +cfg_keys = 'version description keywords author author_email'.split() +expected = cfg_keys + "lib_name user branch license status min_python audience language".split() +for o in expected: assert o in cfg, "missing expected setting: {}".format(o) +setup_cfg = {o:cfg[o] for o in cfg_keys} + +licenses = { + 'apache2': ('Apache Software License 2.0','OSI Approved :: Apache Software License'), + 'mit': ('MIT License', 'OSI Approved :: MIT License'), + 'gpl2': ('GNU General Public License v2', 'OSI Approved :: GNU General Public License v2 (GPLv2)'), + 'gpl3': ('GNU General Public License v3', 'OSI Approved :: GNU General Public License v3 (GPLv3)'), + 'bsd3': ('BSD License', 'OSI Approved :: BSD License'), +} +statuses = [ '1 - Planning', '2 - Pre-Alpha', '3 - Alpha', + '4 - Beta', '5 - Production/Stable', '6 - Mature', '7 - Inactive' ] +py_versions = '3.6 3.7 3.8 3.9 3.10'.split() + +requirements = shlex.split(cfg.get('requirements', '')) +if cfg.get('pip_requirements'): requirements += shlex.split(cfg.get('pip_requirements', '')) +min_python = cfg['min_python'] +lic = licenses.get(cfg['license'].lower(), (cfg['license'], None)) +dev_requirements = (cfg.get('dev_requirements') or '').split() + +setuptools.setup( + name = cfg['lib_name'], + license = lic[0], + classifiers = [ + 'Development Status :: ' + statuses[int(cfg['status'])], + 'Intended Audience :: ' + cfg['audience'].title(), + 'Natural Language :: ' + cfg['language'].title(), + ] + ['Programming Language :: Python :: '+o for o in py_versions[py_versions.index(min_python):]] + (['License :: ' + lic[1] ] if lic[1] else []), + url = cfg['git_url'], + packages = setuptools.find_packages(), + include_package_data = True, + install_requires = requirements, + extras_require={ 'dev': dev_requirements }, + dependency_links = cfg.get('dep_links','').split(), + python_requires = '>=' + cfg['min_python'], + long_description = open('README.md').read(), + long_description_content_type = 'text/markdown', + zip_safe = False, + entry_points = { + 'console_scripts': cfg.get('console_scripts','').split(), + 'nbdev': [f'{cfg.get("lib_path")}={cfg.get("lib_path")}._modidx:d'] + }, + **setup_cfg) + +