Skip to content

Commit

Permalink
Merge pull request #3 from wsp-sag/dev
Browse files Browse the repository at this point in the history
Overhauled package structure
  • Loading branch information
bccheung authored Dec 20, 2024
2 parents e86141f + fa81183 commit e72a5e4
Show file tree
Hide file tree
Showing 82 changed files with 2,281 additions and 8,945 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
jacquard/_version.py export-subst
# SCM syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
60 changes: 60 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This workflow will upload a Python Package to PyPI when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build release distributions
run: |
# NOTE: put your own distribution build steps here.
python -m pip install build
python -m build
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

# Dedicated environments with protections for publishing are strongly recommended.
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
environment:
name: pypi
url: https://pypi.org/p/wsp-jacquard

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
84 changes: 77 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
_version.py
rattler-build/output/

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -38,14 +41,17 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -55,6 +61,7 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -67,16 +74,51 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version
# IPython
profile_default/
ipython_config.py

# celery beat schedule file
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand All @@ -102,11 +144,39 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# vscode stuff
.vscode/
# Cython debug symbols
cython_debug/

# pycharm stuff
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

_build/
# VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

# pixi environments
.pixi
*.egg-info
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

20 changes: 12 additions & 8 deletions readme.md → README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# Jacquard (wsp-jacquard)

[![Conda Latest Release](https://anaconda.org/wsp_sap/wsp-jacquard/badges/version.svg)](https://anaconda.org/wsp_sap/wsp-jacquard)
[![Conda Last Updated](https://anaconda.org/wsp_sap/wsp-jacquard/badges/latest_release_date.svg)](https://anaconda.org/wsp_sap/wsp-jacquard)
[![Platforms](https://anaconda.org/wsp_sap/wsp-jacquard/badges/platforms.svg)](https://anaconda.org/wsp_sap/wsp-jacquard)
[![License](https://anaconda.org/wsp_sap/wsp-jacquard/badges/license.svg)](https://github.com/wsp-sag/wsp-jacquard/blob/master/LICENSE)

A JSON-based configuration handler for models

Historically, a [Jacquard machine is a programmable loom controlled by a chain of cards](https://en.wikipedia.org/wiki/Jacquard_machine); the term "jacquard" refers to the card (or set of cards) used to configure the machine. The `jacquard` library is designed to facilitate application of models, where the a model's configuration (locations of data, options, parameters) are stored in a human-readable JSON file.

Jacquard is developed and maintained by WSP Canada's Systems Analytics for Policy group.

> [!IMPORTANT]
> As of v2.0, this package is imported using `wsp_jacquard` instead of `jacquard`
## Installation

Jacquard can be installed with conda by running:
Jacquard can be installed by running:

```batch
pip install wsp-jacquard
```

or

```batch
conda install -c wsp_sap wsp-jacquard
Expand Down Expand Up @@ -41,7 +45,7 @@ n_iterations = int(d['traffic_assignment']['iterations'])
with

```python
from jacquard import Jacquard
from wsp_jacquard import Jacquard

config = Jacquard.from_file(r"path/to/example.json")

Expand Down Expand Up @@ -83,7 +87,7 @@ Using a Jacquard to self-validate a file is best shown by example:
```

```python
from jacquard import Jacquard
from wsp_jacquard import Jacquard

config = Jacquard.from_file(r"path/to/example.json")

Expand Down
1 change: 0 additions & 1 deletion __init__.py

This file was deleted.

30 changes: 0 additions & 30 deletions conda_recipe/meta.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions docs/.buildinfo

This file was deleted.

Empty file removed docs/.nojekyll
Empty file.
4 changes: 2 additions & 2 deletions apidocs/Makefile → docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
17 changes: 0 additions & 17 deletions docs/_sources/api_reference/index.rst.txt

This file was deleted.

23 changes: 0 additions & 23 deletions docs/_sources/index.rst.txt

This file was deleted.

Loading

0 comments on commit e72a5e4

Please sign in to comment.