Skip to content

Commit 7793b7f

Browse files
authored
Merge pull request #57 from UBC-MDS/dev
Merging development to main branch
2 parents d700289 + 0d143ba commit 7793b7f

25 files changed

+830
-21
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
# Name of the workflow
4+
name: CI
5+
6+
# Controls when the workflow will run
7+
on:
8+
# Triggers the workflow on push or pull request events but only for
9+
# the main branch
10+
push:
11+
branches: [ main , dev ]
12+
pull_request:
13+
branches: [ main , dev]
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
# A workflow run is made up of one or more jobs that can run
19+
# sequentially or in parallel
20+
jobs:
21+
# This workflow contains a single job called "build"
22+
build:
23+
# The type of runner that the job will run on
24+
runs-on: ubuntu-latest
25+
26+
strategy:
27+
matrix:
28+
python-version: ['3.10', '3.11', '3.12', '3.13']
29+
30+
# Steps represent a sequence of tasks that will be executed as
31+
# part of the job
32+
steps:
33+
# Checks-out your repository so your job can access it
34+
- name: Check-out repository
35+
uses: actions/checkout@v2
36+
37+
# Set up Python
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
# Install dependencies
44+
- name: Install dependencies
45+
run: |
46+
python -m pip install --upgrade pip
47+
pip install -e .[tests]
48+
49+
# Run pytest with coverage
50+
- name: Run tests with coverage
51+
run: |
52+
pytest --cov --cov-report=term --cov-branch

.github/workflows/deploy.yaml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Workflow for publishing into pyPI
2+
3+
name: ci-cd
4+
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
branches: [ main ]
10+
workflow_dispatch:
11+
12+
jobs:
13+
ci:
14+
# Set up operating system
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
python-version: ['3.10', '3.11', '3.12', '3.13']
20+
21+
# Steps represent a sequence of tasks that will be executed as
22+
# part of the job
23+
steps:
24+
# Checks-out your repository so your job can access it
25+
- name: Check-out repository
26+
uses: actions/checkout@v2
27+
28+
# Set up Python
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
# Install dependencies
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install -e .[tests]
39+
40+
# Run pytest with coverage
41+
- name: Run tests with coverage
42+
run: |
43+
pytest --cov --cov-report=term --cov-branch
44+
45+
cd:
46+
47+
# Set up operating system
48+
runs-on: ubuntu-latest
49+
50+
permissions:
51+
id-token: write
52+
contents: write
53+
# Only run this job if the "ci" job passes
54+
needs: ci
55+
56+
# Only run this job if new work is pushed to "main" or "dev"
57+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main')
58+
59+
# Define job steps
60+
steps:
61+
- name: Check-out repository
62+
uses: actions/checkout@v3
63+
with:
64+
fetch-depth: 0
65+
66+
- name: Set up Python 3.12
67+
uses: actions/setup-python@v4
68+
with:
69+
python-version: 3.12
70+
71+
# Install dependencies
72+
- name: Install dependencies
73+
run: |
74+
python -m pip install --upgrade pip
75+
pip install -e .[dev]
76+
77+
- name: Hatch build locally
78+
run: hatch build
79+
80+
- name: Publish to TestPyPI
81+
uses: pypa/gh-action-pypi-publish@release/v1
82+
with:
83+
repository-url: https://test.pypi.org/legacy/
84+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
85+
86+
testdumbpy:
87+
88+
# Set up operating system
89+
runs-on: ubuntu-latest
90+
91+
needs: cd
92+
93+
strategy:
94+
matrix:
95+
python-version: ['3.10', '3.11', '3.12', '3.13']
96+
97+
steps:
98+
99+
- uses: actions/setup-python@v5
100+
with:
101+
python-version: ${{ matrix.python-version }}
102+
103+
- name: Test install from TestPyPI
104+
run: |
105+
python -m pip install --upgrade pip
106+
pip install \
107+
--index-url https://test.pypi.org/simple/ \
108+
--extra-index-url https://pypi.org/simple/ \
109+
dumbpy
110+
111+
112+

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.12"
28+
29+
- name: Install package + quartodoc + jupyter
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -e .
33+
pip install quartodoc jupyter nbformat
34+
35+
- name: Generate reference pages
36+
run: quartodoc build --config docs/_quarto.yml
37+
38+
- uses: quarto-dev/quarto-actions/setup@v2
39+
40+
- name: Render Quarto site
41+
run: quarto render docs
42+
43+
- uses: actions/configure-pages@v5
44+
45+
- uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: docs/_site
48+
49+
deploy:
50+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
51+
needs: build
52+
runs-on: ubuntu-latest
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
steps:
57+
- id: deployment
58+
uses: actions/deploy-pages@v4

README.md

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
# Welcome to dumbpy
22

3-
| | |
4-
|------------------------------------|------------------------------------|
5-
| Package | [![Latest PyPI Version](https://img.shields.io/pypi/v/dumbpy.svg)](https://pypi.org/project/dumbpy/) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/dumbpy.svg)](https://pypi.org/project/dumbpy/) |
6-
| Meta | [![Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) |
7-
8-
*TODO: the above badges that indicate python version and package version will only work if your package is on PyPI. If you don't plan to publish to PyPI, you can remove them.*
9-
103
DumbPy is an alternative version of NumPy, which facilitates scientific computing using Python. DumbPy contains numeric functions that provide useful summary statistics of numerical lists, listed below. DumbPy additionally carries out strict input testing to provide clear and user-friendly error messages and facilitate proper usage.
114

125
DumbPy Functions:
@@ -21,18 +14,12 @@ DumbPy Functions:
2114

2215
As stated above, the NumPy package already exists and provides similar functions. NumPy can be found at the following link: <https://numpy.org/>. DumbPy is an alternative version, which is much simpler and has a narrower focus.
2316

24-
## Contributors
25-
26-
- Hector Prieto
27-
- Nicole Link
28-
- Samrawit Mezgebo
29-
3017
## Get started
3118

3219
You can install this package into your preferred Python environment using pip:
3320

3421
``` bash
35-
$ pip install dumbpy
22+
pip install dumbpy
3623
```
3724

3825
To use dumbpy in your code:
@@ -43,7 +30,63 @@ To use dumbpy in your code:
4330
2.0
4431
```
4532

33+
## Contributors
34+
35+
- Hector Palafox
36+
- Nicole Link
37+
- Samrawit Mezgebo
38+
39+
40+
## Development
41+
42+
**1) Clone the repository**
43+
```bash
44+
git clone https://github.com/UBC-MDS/dumbpy.git
45+
cd dumbpy
46+
```
47+
48+
**2) Create the conda environment**
49+
50+
```bash
51+
conda env create -f environment.yml
52+
```
53+
54+
**3) Activate the environment**
55+
56+
```bash
57+
conda activate dumbpy-env
58+
```
59+
60+
**4) Install the package locally**
61+
62+
```bash
63+
python -m pip install -e .
64+
```
65+
66+
**5) Run the test suite**
67+
68+
```bash
69+
pytest
70+
```
71+
72+
**6) Build the documentation**
73+
74+
```bash
75+
cd docs
76+
quarto render
77+
```
78+
79+
**7) Preview the documentation locally(optional)**
80+
81+
```bash
82+
quarto preview
83+
```
84+
85+
Docs are deployed automatically via GitHub Actions on merges to the deployment branch.
86+
87+
Deployed docs: <add github pages url here>
88+
4689
## Copyright
4790

48-
- Copyright © 2026 Hector Palafox.
91+
- Copyright © 2026 Hector Palafox, Nicole Link, Samrawit Mezgebo.
4992
- Free software distributed under the [MIT License](./LICENSE).
File renamed without changes.
File renamed without changes.

docs/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.quarto/
2+
**/*.quarto_ipynb
3+
4+
# Quarto build output
5+
_site/
6+
.quarto/

docs/_quarto.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
project:
2+
type: website
3+
4+
execute:
5+
enabled: false
6+
7+
jupyter: python3
8+
9+
# tell quarto to read the generated sidebar + styles from quartodoc
10+
metadata-files:
11+
- reference/_sidebar.yml
12+
13+
format:
14+
html:
15+
theme: cosmo
16+
toc: true
17+
css:
18+
- reference/_styles-quartodoc.css
19+
20+
website:
21+
title: "dumbpy"
22+
navbar:
23+
left:
24+
- href: index.qmd
25+
text: Home
26+
- href: examples.qmd
27+
text: Examples
28+
- href: reference/index.qmd
29+
text: Reference
30+
31+
quartodoc:
32+
package: dumbpy
33+
sidebar: reference/_sidebar.yml
34+
css: reference/_styles-quartodoc.css
35+
sections:
36+
- title: Public API
37+
desc: Core functions exported by `dumbpy`.
38+
contents:
39+
- arithmetic_mean
40+
- std_deviation
41+
- median
42+
- flatten_list
43+
- validate_list

0 commit comments

Comments
 (0)