Skip to content

Commit 60a9c8f

Browse files
committed
docs: Refactor docs and add more contributing information
1 parent 0a92874 commit 60a9c8f

File tree

14 files changed

+184
-119
lines changed

14 files changed

+184
-119
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Changed:
9+
- Misc: Documentation to include more contribution information and guidelines.
810

911
## [0.18.2] - 2024-06-01
1012
### Changed:

docs/contributing.md

Lines changed: 0 additions & 93 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ hide:
77
# ⏰ Benchmarks
88

99
<div>
10-
<iframe onload="resizeIframe(this)" scrolling="no" style="width:100vw; border:none" src="../dev/bench/index.html"></iframe>
10+
<iframe onload="resizeIframe(this)" scrolling="no" style="width:100vw; border:none" src="../../dev/bench/index.html"></iframe>
1111
</div>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ title: Binary Tree
77
For **Binary Tree** implementation, there are 3 main components.
88
Binary Node inherits from Node, so the components in Tree implementation are also available in Binary Tree.
99

10-
## [**🌿 Node**](bigtree/node/index.md)
10+
## [**🌿 Node**](../bigtree/node/index.md)
1111
- ``BinaryNode``, Node with binary tree rules
1212

13-
## [**✨ Constructing Binary Tree**](bigtree/binarytree/construct.md)
13+
## [**✨ Constructing Binary Tree**](../bigtree/binarytree/construct.md)
1414
- From *list*, using flattened list structure
1515

16-
## [**➰ Traversing Binary Tree**](bigtree/utils/iterators.md)
16+
## [**➰ Traversing Binary Tree**](../bigtree/utils/iterators.md)
1717
- In-Order Traversal
File renamed without changes.

docs/home/community.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Community
3+
---
4+
5+
# 🐾 Community
6+
There are many ways to contribute to bigtree
7+
8+
* Give bigtree a 🌟 on [GitHub](https://github.com/kayjan/bigtree)
9+
* [Share](https://github.com/kayjan/bigtree/discussions/52) your bigtree projects
10+
* [Contribute](contributing.md) to bigtree open source libraries
11+
* Support bigtree on [buymeacoffee](https://buymeacoffee.com/kayjan)

docs/home/contributing.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: Contributing
3+
---
4+
5+
# 🍪 Contributing
6+
bigtree is a tree implementation package for Python. It integrates with Python lists, dictionaries, pandas and
7+
polars DataFrame.
8+
9+
Thank you for taking the time to contribute. Contributing to this package is an excellent opportunity to dive into
10+
tree implementations.
11+
12+
## Set Up
13+
14+
First, [fork the repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo) and
15+
clone the forked repository.
16+
17+
```console
18+
$ git clone git@github.com:<your-username>/bigtree.git
19+
```
20+
21+
Next, create a virtual environment and activate it.
22+
23+
=== "conda"
24+
```console
25+
$ conda create -n bigtree_venv python=3.10
26+
$ conda activate bigtree_venv
27+
```
28+
29+
=== "venv"
30+
```console
31+
$ python -m venv .venv
32+
$ source .venv/bin/activate
33+
```
34+
35+
To check if it worked,
36+
37+
=== "conda"
38+
```console
39+
$ which pip
40+
/<some directory>/envs/bigtree_venv/bin/pip
41+
```
42+
43+
=== "venv"
44+
```console
45+
$ which pip
46+
/<current directory>/.venv/bin/pip
47+
```
48+
49+
From the project folder, install the required python packages locally in editable mode and set up pre-commit checks.
50+
51+
$ python -m pip install -e ".[all]"
52+
$ python -m pip install pre-commit
53+
$ pre-commit install
54+
55+
## Developing
56+
57+
After making your changes, create a new branch, add and commit your changed files.
58+
In this example, let's assume the changed file is `README.md`.
59+
If there are any pre-commit changes or comments, do modify, re-add and re-commit your files.
60+
61+
```console
62+
$ git checkout -b chore/update-readme
63+
$ git add README.md
64+
$ git commit -m "chore: updated README"
65+
```
66+
67+
Push your changes to your created branch and [create a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) from your fork.
68+
69+
```console
70+
$ git push origin chore/update-readme
71+
```
72+
73+
## Testing
74+
75+
If there are changes related to code, make sure to add or update the tests accordingly.
76+
Run the following lines of code and ensure the <mark>unit tests pass</mark> and the
77+
<mark>code coverage is 100%</mark>.
78+
79+
```console
80+
$ python -m pip install pytest coverage
81+
$ pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=bigtree
82+
```
83+
84+
## Documentation
85+
86+
If there are changes related to code, make sure to add or update the documentations and docstrings accordingly.
87+
88+
For documentation, `bigtree` uses [mkdocs](https://www.mkdocs.org) for documentation and previews can be viewed
89+
by running the following lines of code.
90+
91+
```console
92+
$ python -m pip install hatch
93+
$ hatch run mkdocs:build
94+
$ hatch run mkdocs:serve
95+
```
96+
97+
For docstrings, ensure that the description is most updated and existing, added, or modified sample code examples
98+
in docstring still work. Run the following lines of code to generate the <mark>coverage report and test report for
99+
docstrings</mark>. Refer to the console log for information on the file location of the reports.
100+
101+
```console
102+
$ python -m pip install hatch
103+
$ hatch run docs:coverage
104+
$ hatch run docs:doctest
105+
```
106+
107+
## Consequent Changes
108+
109+
Please [open an issue](https://github.com/kayjan/bigtree/issues/new/choose) to discuss important changes before
110+
embarking on an implementation.

docs/home/convention.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Convention and Standards
3+
---
4+
5+
# 💬 Convention and Standards
6+
7+
8+
## Git Workflow
9+
10+
When creating branches, it is recommended to create them in the format `type/action`. For example,
11+
12+
```console
13+
$ git checkout -b feat/add-this
14+
```
15+
16+
This project enforces [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
17+
when writing commit messages.
18+
19+
- The regex for conventional commits is as such `(?s)(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)(\(\S+\))?!?:( [^\n\r]+)((\n\n.*)|(\s*))?$`.
20+
21+
## Code Format
22+
23+
During pre-commit checks, this project checks and formats code using `black`, `flake8`, `isort`, and `mypy`.
24+
25+
## Testing
26+
27+
For testing, this project uses `pytest` and `coverage` package for testing of codes,
28+
and `doctest` and `docstr-coverage` package for testing of docstrings.
29+
30+
## Documentation
31+
32+
For documentation, this project follows the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html).

docs/dag.md renamed to docs/home/dag.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ title: Directed Acyclic Graph (DAG)
66

77
For **Directed Acyclic Graph (DAG)** implementation, there are 4 main components.
88

9-
## [**🌼 Node**](bigtree/node/index.md)
9+
## [**🌼 Node**](../bigtree/node/index.md)
1010
- ``DAGNode``, extendable class for constructing Directed Acyclic Graph (DAG)
1111

12-
## [**✨ Constructing DAG**](bigtree/dag/construct.md)
12+
## [**✨ Constructing DAG**](../bigtree/dag/construct.md)
1313
- From *list*, containing parent-child tuples
1414
- From *nested dictionary*
1515
- From *pandas DataFrame*
1616

17-
## [**➰ Traversing DAG**](bigtree/utils/iterators.md)
17+
## [**➰ Traversing DAG**](../bigtree/utils/iterators.md)
1818
- Generic traversal method
1919

20-
## [**🔨 Exporting DAG**](bigtree/dag/export.md)
20+
## [**🔨 Exporting DAG**](../bigtree/dag/export.md)
2121
- Export to *list*, *dictionary*, or *pandas DataFrame*
2222
- Export DAG to *dot* (can save to .dot, .png, .svg, .jpeg files)
File renamed without changes.

0 commit comments

Comments
 (0)