Skip to content

Commit

Permalink
Lifcyecle manegement development notes
Browse files Browse the repository at this point in the history
  • Loading branch information
jurra committed Oct 3, 2023
1 parent 005b0bd commit 7c4121b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Warning:
> The current version only supports Linux.

PyMurTree is a Python wrapper for the [MurTree project](https://github.com/DCC/murtree). The MurTree algorithm constructs optimal classification trees that minimize the misclassification score of a given dataset while respecting constraints on depth and number of feature nodes. The sparse objective, which penalizes each node added in the tree, is also supported.
PyMurTree is a Python wrapper for the [MurTree project](https://github.com/MurTree/murtree). The MurTree algorithm constructs optimal classification trees that minimize the misclassification score of a given dataset while respecting constraints on depth and number of feature nodes. The sparse objective, which penalizes each node added in the tree, is also supported.

---
## **Citation**
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Welcome to PyMurTree's documentation!
:caption: For developers

api_reference
lifecycle.md


Indices and tables
Expand Down
24 changes: 24 additions & 0 deletions docs/lifecycle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Lifecycle & automation
All the CI automation and lifecycle management is done through GitHub Actions.
There are different rules for different workflows.

## Development and branching
Even though we are not strictly using [git-flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow#:~:text=Gitflow%20is%20an%20alternative%20Git,lived%20branches%20and%20larger%20commits.), we are following a similar branching strategy.
- All features are developed in feature branches. `git checkout -b feature/my_feature`
- All features are merged into the `develop` branch. `git checkout develop && git merge feature/my_feature`
- All bugfixes are developed in bugfix branches. `git checkout -b bugfix/my_bugfix`

### Forking and Pull requests
- Promote forking of the repository for better collaboration. This is a good practice for open source projects. This will allow you also to have control over rights, permissions and actions environments.
- This also allows you to have a separate repository for a contributors own development and testing. Contributers can then make a PR to the main repository when you are ready.
- Contributing from forks can only be made through Pull requests, this makes the overall codebase management more transparent.
- Furthermore there are specific automations like tests that are triggered on pull requests. This is a good way to make sure that the code is tested before merging, and educates contributors in writing tests.

## What is automated?
- Tests on every pull request to develop and main branches for all platforms (Linux, Windows, MacOS). Worfklow: [`pip.yaml`](../.github/workflows/pip.yml).
- Automatic build and distribution to pypi on every release. Workflow: [`pypi.yaml`](../.github/workflows/wheels.yml).
- Automatic documentation generation. Workflow: [`docs.yaml`](../.github/workflows/docs.yaml).

## Releasing
- Update the version number in `pyproject.toml`. Do the same for the citation file. `CITAION.cff``.
- Use the release tag in GitHub to create a new release. This will trigger the automatic build and distribution to pypi. This manual step will trigger the workflow: [`pypi.yaml`](../.github/workflows/wheels.yaml).
21 changes: 1 addition & 20 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,7 @@ ctest

## Usage

### API

The full [API specification](https://github.com/MurTree/pymurtree/wiki/API-documentation) is available in the repo's Wiki.

pymurtree is implemented as a thin Python wrapper around the main C++ MurTree application. The main functionality of MurTree is exposed in pymurtree via the OptimalDecisionTreeClassifier class. Utility functions to load training datasets and export the tree in text and dot formats are also included in the python package.

**OptimalDecisionTreeClassifier class**
- `constructor`: initialize the parameters of the model
- `fit`: fit a decision tree classifier to the given training dataset
- `predict`: predict the labels for a set of features
- `score`: return the accuracy on the given test data and labels
- `depth`: return the depth of the tree
- `num_nodes`: return the number of nodes of the tree
- `export_text`: export decision tree in text format
- `export_dot`: export decision tree in DOT format

**Utility functions**
- `read_from_file`: read features and labels from file into a pandas dataframe
- `load_data`: read features and labels from file into a numpy array

The full [API specification](https://murtree.github.io/pymurtree/api_reference.html) is available in the repo's documentation.

### Example

Expand Down

0 comments on commit 7c4121b

Please sign in to comment.