Giter Club home page Giter Club logo

masteroppgave's Introduction

Coverage StatusQuality Gate Status

πŸ“‹ Issue board. βš—οΈ Neptune.ai

Project basics

The basics of how to set up and run this project

Install project

Make sure python 3.8 is installed.

From project root run:

Setup up python virtual env: virtualenv --python=/usr/bin/python3.x env && source env/bin/activate

Install project and dependencies pip install -r requirements.txt

Installing git hooks

./scripts/install-git-hooks.sh

Running experiments

Run python src/main.py --help to get a help message.

Run an experiment python src/main.py -e <experiment-title-wihout-spaces> "<description of the experiment>"

Running tests

From project root run: mamba

External API tests takes a long time to run. To just run the fast local tests run: mamba -t unit,integration

Formatting source files to code formatting standards

Run black src spec


Git conventions

Commit conventions

When committing new content to git correct and structured conventions should be utilized. In addition to marking commits with the issue number fro 'linear', a commit should always contain a type descriptions (such as for a feature, experiment, test, and so forth),

This inclues the use of prefixes to the commit messages used. The following are the relevant conventions for this project:

Prefix Content
feat/ Describes that there is a new feature added
test/ Describes that the contents of the commit is to add tests
exp/ Identification to use in case of an experiment.
ref/ Refactoring code / Rewriting code
paper/ Updates done to the paper

The commit should start with the type prefix, followed by the MAS code if there is any, lastly followed by a description of the commit function.

Examples
feat/MAS-30/Add-functionality-for-saving-figures
test/Add-missing-tests-with-saving-figures

Branch naming convention

Branches should follow the same naming convention as the one used for commits. The branch name is mostly for clarification, and not as important as the commit messages creating the log to be read at a later time.


Execute jobs on NTNU High Perfomance Computing cluster

Prerequisites:

  1. Setup ssh alias in your SSH config for local NTNU user: <username>@login.stud.ntnu.no
Host idun
	HostName idun-login1.hpc.ntnu.no
	User <username>
  1. Clone this repo into a <username>@login.stud.ntnu.no:~/Masteroppgave
  2. Set up SSH keys for IDUN to github to allow pushing back to the repo
  3. Configure git config on idun to allow commits
  4. Create a .env file in <username>@login.stud.ntnu.no:~/Masteroppgave/.env with the contents described below

Running experiments:

  1. Write code for the experiment
  2. Add or tune a .slurm file in batch_Jobs/
  3. Run ./scripts/execute_experiment_hpc.sh <job-file.slurm> <Job Name> <Job description>

##Basic batch job commands

  • Start job: sbatch <slurm_file>
  • See jobs: squeue -u <username>
  • Cancel jobs: scancel <job-id>

SLURM files - Config

In order to execute code on the HPC cluster, the cluster expects the use of a config file in the form of a ".slurm" file. Such ".slurm" files have already been created and are located under the folder "batch_jobs/".

Before a test is run on the HPC cluster, one should update the current values of the *.slurm files. The values to be updated are information such as job_name, mail for receiving information, etc.

Environment variables

Create a .env file in root folder to configure project related environment variables

# Email used to send HPC batch job status emails
EMAIL=<email>
USERNAME=<NTNU-username>
LOG_FILE=<batch_job_log_file> default: batch_jobs/output/sbatch_job.txt
NEPTUNE_API_TOKEN=<api-token>

UML Diagram

UML class

Folder structure

β”œβ”€β”€ .pylintrc          <- Python style guidance
β”œβ”€β”€ README.md          <- The top-level README for developers using this project.
β”œβ”€β”€ .env               <- Environment variables
β”‚
β”‚
β”œβ”€β”€ batch_jobs		   <- Batch .slurm files for executing workloads on HPC-cluster
β”‚   └── output         <- Log output from batch_jobs
β”‚
β”œβ”€β”€ data
β”‚   β”œβ”€β”€ external       <- Data from third party sources.
β”‚   β”œβ”€β”€ interim        <- Intermediate data that has been transformed.
β”‚   β”œβ”€β”€ processed      <- The final, canonical data sets for modeling.
β”‚   └── raw            <- The original, immutable data dump.
β”‚
β”œβ”€β”€ models             <- Trained and serialized models, model predictions, or model summaries
β”‚
β”œβ”€β”€ notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
β”‚                         the creator's initials, and a short `-` delimited description, e.g.
β”‚                         `1.0-jqp-initial-data-exploration`.
β”‚
β”œβ”€β”€ reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
β”‚   └── figures        <- Generated graphics and figures to be used in reporting
β”‚
β”œβ”€β”€ requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
β”‚                         generated with `pip freeze > requirements.txt`
β”‚
β”œβ”€β”€ setup.py           <- makes project pip installable (pip install -e .) so src can be imported
β”œβ”€β”€ src                <- Source code for use in this project.
β”‚   β”œβ”€β”€ __init__.py    <- Makes src a Python module
β”‚   β”œβ”€β”€ main.py		   <- Main file for project
β”‚   β”œβ”€β”€ experiment.py  <- Experiment class
β”‚   β”‚
β”‚   β”‚
β”‚   β”œβ”€β”€ data_types     <- Data classes, enums and data types.
β”‚   β”‚
β”‚   β”œβ”€β”€mode-_structures<- Scripts to train models and then use trained models to make
β”‚   β”‚   β”‚                 predictions
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚   └── ...
β”‚   β”‚
β”‚   β”œβ”€β”€ pipelines      <- Data processing pipelines
β”‚   β”‚
β”‚   β”œβ”€β”€ utils		   <- Utilities and helper functinos
β”‚   β”‚   β”œβ”€β”€ config_parser.py
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚   └── logger.py
β”‚   β”‚
β”‚   β”‚
β”‚   └── visualization  <- Scripts to create exploratory and results oriented visualizations
β”‚       └── ...
β”‚
β”œβ”€β”€ spec/		       <- Spesification tests for the project
└── tox.ini            <- tox file with settings for running tox; see tox.testrun.org

masteroppgave's People

Contributors

sjsivert avatar sanderkk avatar

Stargazers

Brage Lytskjold avatar

Watchers

 avatar

masteroppgave's Issues

Add mamba test wrapper class

Right now all error logging calls are set to logging.info().
This is because logging.warning() and above will show while running tests.
Wrapping mamba.describe class with a custom class that sets logging verbose to a lower level
might fix this.

  • Make DescribeLogging class
  • Refactor all instanses with the new class
  • Change all error loggins to use warning and error instead of info

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.