Skip to content

Commit

Permalink
Merge pull request #1 from kausalflow/init
Browse files Browse the repository at this point in the history
Initialize the repo
  • Loading branch information
emptymalei authored Feb 19, 2024
2 parents 5ea31e9 + f94bf4e commit 2830720
Show file tree
Hide file tree
Showing 15 changed files with 1,348 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/docs-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Docs
on:
push:
branches:
- main
workflow_dispatch:
inputs:
directory:
description: 'Build docs'
default: 'build it now'
required: false


jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.3.2
- name: Install Packages
run: poetry install --with docs
- run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Deploy
run: poetry run mkdocs gh-deploy --force
50 changes: 50 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Publish Package to Pypi

on:
push:
branches:
- "main"

jobs:
tests:
strategy:
matrix:
python-version: [3.9,3.10]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.3.2
- name: Install Packages
run: poetry install --with docs,test
- name: Build coverage file
run: |
pytest --cache-clear --cov=app tests/ > pytest-coverage.txt
- name: Comment coverage
uses: coroo/[email protected]
build-n-publish:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10
# - name: Generate dist
# run: python setup.py sdist
# - name: Publish package
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Code with Pip

on:
push:
branches:
- "**"
- "!gh-pages"
pull_request:
branches:
- main
workflow_dispatch:
inputs:
name:
description: 'Test It'
required: false
default: 'I Just wanna test it'

jobs:
build:
strategy:
matrix:
python-version: [3.9, "3.10"]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.3.2
- name: Install Packages
run: poetry install --with docs
- name: Build coverage file
run: |
poetry run pytest --cache-clear --cov=app tests/ > pytest-coverage.txt
- name: Comment coverage
uses: coroo/[email protected]
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
exclude: "^notebooks/|^notes/"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-added-large-files
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.960
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
files: ^(hamiltonian_flow/|tests/)
- repo: https://github.com/ambv/black
rev: 22.10.0
hooks:
- id: black
language: python
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args: ["--multi-line", "3", "--profile", "black"]
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include README.md
include pyproject.toml
include LICENSE
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# hamiltonian_flow

Dataset of simple physical systems.
Binary file added docs/.DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# hamiltonian_flow Changelog

## 2024-02-18, 0.0.1

Setting up repository.
28 changes: 28 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Documentation for `hamiltonian_flow`

Generating dataset for physical systems.

## Development

We use `poetry` to manage our python environment. Use

```sh
poetry install
```

to install the requirements. Or run

```sh
poetry install --with test
```

to install the base environment and test environment for development.


If this is the first you clone the repo and committing code, run

```sh
pre-commit install
```

first.
1 change: 1 addition & 0 deletions docs/references/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# References
1 change: 1 addition & 0 deletions docs/tutorials/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Tutorials
Empty file added hamiltonian_flow/__init__.py
Empty file.
81 changes: 81 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# mkdocs.yml
site_name: "Hamiltonian Flow"
site_author: ""
site_description: "Dataset of simple physical systems."
site_url: "https://kausalflow.github.io/hamiltonian_flow"
repo_url: "https://github.com/kausalflow/hamiltonian_flow"
edit_uri: "blob/main/docs/"
repo_name: "kausalflow/hamiltonian_flow"


theme:
name: "material"
# Don't include MkDocs' JavaScript
include_search_page: false
search_index_only: true

# Default values, taken from mkdocs_theme.yml
language: en
features:
# - navigation.instant
- navigation.sections
- navigation.tabs
palette:
- scheme: default
primary: indigo
accent: indigo
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
- scheme: slate
primary: red
accent: red
toggle:
icon: material/toggle-switch
name: Switch to light mode
font:
text: Roboto
code: Roboto Mono
# favicon: assets/logo.png
# logo: assets/logo_transparent.png



markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.emoji
- pymdownx.magiclink
- pymdownx.snippets:
check_paths: true
- pymdownx.superfences
- pymdownx.tabbed
- pymdownx.tasklist
- pymdownx.arithmatex:
generic: true
- toc:
permalink: "¤"

plugins:
- autorefs
- search
- mkdocstrings:
handlers:
python:
selection:
docstring_style: sphinx
watch:
- docs

extra_javascript:
- javascripts/mathjax.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

nav:
- "Home": index.md
- "Tutorials":
- "Introduction": tutorials/index.md
- References:
- "Introduction": references/index.md
- "Changelog": changelog.md
Loading

0 comments on commit 2830720

Please sign in to comment.