Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
\[INSERT CONTACT METHOD\].
https://github.com/UBC-MDS/Sudoku_Validation/issues.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
90 changes: 83 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ There are other Python packages that provide similar functionality. Here are som

> Note: this package is a work in progress and might contain example code that is not used in the final product.

## Contributors

Justin Mak: justinmak08@gmail.com
Eric Yang: eric99yang@gmail.com
Kin Chung Choy: kcchoyaa@connect.ust.hk
Omowunmi Obadero: obaderoomowunmi@gmail.com

## Get started

You can install this package into your preferred Python environment using pip:
Expand Down Expand Up @@ -76,6 +69,89 @@ sudoku_board = [
sudoku_validation.combined_validation(sudoku_board)
```

## 📚 Documentation

The full documentation for this package is built using **Quarto** and **Quartodoc** and
is automatically deployed to **GitHub Pages** via GitHub Actions.

Live documentation:
[https://ubc-mds.github.io/Sudoku_Validation/](https://ubc-mds.github.io/Sudoku_Validation/)

The documentation includes:
- A full API reference generated with Quartodoc
- Usage examples for all validation functions
- Developer instructions for building and previewing documentation



## 👥 For Developers

This section provides instructions for contributors and developers working on
the Sudoku Validation package.

### Setting Up the Development Environment

#### 1. Clone the repository

```bash
git clone https://github.com/UBC-MDS/Sudoku_Validation.git
cd sudoku_validation
```

#### 2. Create an Environment Using Conda

```bash
conda env create -f environment.yml
conda activate sudoku-validation
```

#### 3. Install the package in Development Mode

```bash
pip install -e ".[dev]"
```

#### Running Tests

Execute the full test suite:
```bash
pytest
```

#### Building Documentation

Build documentation locally:
```bash
cd docs
quarto render
```
To preview documentation in a browser:
```bash
quarto preview
```

## Continuous Integration and Deployment

All tests, formatting checks and documentation builds are automatically built and deployed using GitHub Actions.
On every push to the main branch, Quarto renders the documentation and publishes
it to GitHub Pages.
No manual deployment steps are required.


## Contributing

Please check contributing for guidelines on:
Reporting bugs
Suggesting features
Submitting pull requests

## Contributors

Justin Mak: justinmak08@gmail.com
Eric Yang: eric99yang@gmail.com
Kin Chung Choy: kcchoyaa@connect.ust.hk
Omowunmi Obadero: obaderoomowunmi@gmail.com

## Copyright

- Copyright © 2026 Justin Mak, Eric Yang, Kin Chung Choy, Omowunmi Obadero.
Expand Down
15 changes: 15 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: sudoku_validation

channels:
- conda-forge

dependencies:
- python=3.12
- numpy
- pandas
- pytest
- quarto
- pip

- pip:
- quartodoc
39 changes: 39 additions & 0 deletions tests/unit/test_validate_board_extra.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'''
Add 4 unit test to trigger checks
'''
import pytest
from sudoku_validation.row_validation import row_validation

def test_validate_rows_valid():
board = [
[1,2,3,4,5,6,7,8,9],
[4,5,6,7,8,9,1,2,3],
[7,8,9,1,2,3,4,5,6],
[2,3,4,5,6,7,8,9,1],
[5,6,7,8,9,1,2,3,4],
[8,9,1,2,3,4,5,6,7],
[3,4,5,6,7,8,9,1,2],
[6,7,8,9,1,2,3,4,5],
[9,1,2,3,4,5,6,7,8],
]
assert row_validation(board)

def test_validate_rows_duplicate():
board = [
[1,1,3,4,5,6,7,8,9], # duplicate 1
] + [[0]*9 for _ in range(8)]
assert not row_validation(board)

def test_validate_rows_non_numeric():
board = [
["a",2,3,4,5,6,7,8,9],
] + [[0]*9 for _ in range(8)]
with pytest.raises(ValueError):
row_validation(board)

def test_validate_rows_short_row():
board = [
[1,2,3], # too short
] + [[0]*9 for _ in range(8)]
with pytest.raises(ValueError):
row_validation(board)
Loading