Commit f84eee4d authored by Gabriel Couture's avatar Gabriel Couture

Adding base project

parent 98c1c9aa
*
!.gitignore
!.gitlab-ci.yml
!requirements.txt
!README.md
!main.py
!data/
!data/**
!dvh/
!dvh/**
!tests/
!tests/**
*.pyc
# HowToTestBasic
Example of a basic python project with tests
\ No newline at end of file
Example of a basic python project with tests
## Setup.py
The `setup.py` file is where you setup your commands for the tests.
## Virtual environment
Having a virtual environment per projects is a great idea:
https://realpython.com/python-virtual-environments-a-primer/
To create one, you first need `virtualenv`.
```bash
$ pip install virtualenv
```
After, you can create the virtual environnement in your project path.
Here, my virtual environment will be named `venv`, which is commun for local virtual environment.
```bash
$ virtualenv venv
```
Now, you should have a `venv/` directory in your project root path.
This directory contains the Python interpreter (with pip and other tools) at `./venv/bin/`.
You should use these executable for your project.
## requirements.txt
The `requirements.txt` file contains the needed libraries for the projects and the tests.
You need to have you virtual environment setup before generating the `requirements.txt`.
To generate the `requirements.txt`:
```bash
$ ./venv/bin/pip freeze > requirements.txt
```
*
!.gitignore
!README.md
!dvh_manipulator/
!dvh_manipulator/**
!tests/
!tests/**
*.pyc
# coding: utf-8
# author: gabriel couture
# coding: utf-8
# author: gabriel couture
# coding: utf-8
# author: gabriel couture
import numpy as np
class DVH:
"""
This class is the representation of a DVH.
"""
def __init__(self, doses: np.ndarray, volumes: np.ndarray):
self.doses = doses
self.volumes = volumes
\ No newline at end of file
# coding: utf-8
# author: gabriel couture
if __name__ == '__main__':
pass
# coding: utf-8
# author: gabriel couture
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment