diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ec2d4b1 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,38 @@ +version: 2.1 + +commands: + set_up_build_environment: + steps: + - checkout + - run: + name: Installing SUDO + command: 'apt-get update && apt install -y sudo && rm -rf /var/lib/apt/lists/*' + - run: + name: Run INSTALL DEPENDENCIES + command: bash install_dependencies.sh + - run: + name: Install DSMC + command: pip3 install . + + run_unit_tests: + steps: + - run: + name: Run UNIT TESTS + command: cd tests/unit/ && python3 main.py -v + +executors: + docker-jammy: + docker: + - image: "ubuntu:jammy" + +jobs: + unit_tests: + executor: docker-jammy + steps: + - set_up_build_environment + - run_unit_tests + +workflows: + build-and-run-tests: + jobs: + - unit_tests diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5f8b451 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.0] - 2022-09-15 +### Added +- unit test environment +- cirlce ci integration +- dependency installation script +- dsmc module installation file diff --git a/dsmc/__init__.py b/dsmc/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dsmc/dsmc.py b/dsmc/dsmc.py new file mode 100644 index 0000000..b30dac7 --- /dev/null +++ b/dsmc/dsmc.py @@ -0,0 +1,7 @@ +import math +import numpy +from numba import njit + +@njit +def test(): + return 1.0 diff --git a/install_dependencies.sh b/install_dependencies.sh new file mode 100644 index 0000000..2729edd --- /dev/null +++ b/install_dependencies.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +sudo apt update + +sudo apt install -y python3 +sudo apt install -y python3-pip +sudo apt install -y python3-dbg + +pip3 install --upgrade pip setuptools wheel + +pip3 install numpy +pip3 install llvmlite +pip3 install scipy +pip3 install numba +pip3 install pytest + +echo "INSTALLATION COMPLETE" diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6d1b41d --- /dev/null +++ b/setup.py @@ -0,0 +1,14 @@ +from setuptools import setup +setup( + name='dsmc', + version='0.1.0', + author='Leo Basov', + python_requires='>=3.6, <4', + packages=["dsmc"], + install_requires=[ + 'numpy', + 'llvmlite', + 'scipy', + 'numba' + ], +) diff --git a/tests/unit/main.py b/tests/unit/main.py new file mode 100644 index 0000000..b6e29e3 --- /dev/null +++ b/tests/unit/main.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +import unittest + +from test_dsmc.dsmc import * + +if __name__ == '__main__': + unittest.main() diff --git a/tests/unit/test_dsmc/__init__.py b/tests/unit/test_dsmc/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit/test_dsmc/dsmc.py b/tests/unit/test_dsmc/dsmc.py new file mode 100644 index 0000000..128cccb --- /dev/null +++ b/tests/unit/test_dsmc/dsmc.py @@ -0,0 +1,6 @@ +import unittest +from dsmc import dsmc + +class TestDSMC(unittest.TestCase): + def test_test(self): + self.assertEqual(1.0, dsmc.test())