Skip to content

Commit

Permalink
First commit of 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benhorsburgh committed Jan 28, 2020
1 parent e4e7897 commit 26bc8c6
Show file tree
Hide file tree
Showing 86 changed files with 14,060 additions and 1 deletion.
134 changes: 134 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
version: 2

images:
python: &python
- image: circleci/buildpack-deps:stretch-browsers

###############################################################################
utils:
prepare_container: &prepare_container
name: Prepare build container
command: |
sudo apt-get update
sudo apt-get install curl pandoc
sudo apt-get clean
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh > miniconda.sh
bash miniconda.sh -b -p /home/circleci/miniconda
sudo rm -rf ~/.pyenv/ /opt/circleci/.pyenv/
source /home/circleci/miniconda/etc/profile.d/conda.sh
conda create --name=causalnex_env python=${PYTHON_VERSION} -y
conda activate causalnex_env
conda install -y virtualenv
pip install -U pip setuptools wheel
activate_conda: &activate_conda
name: Activate conda environment
command: |
echo ". /home/circleci/miniconda/etc/profile.d/conda.sh" >> $BASH_ENV
echo "conda deactivate; conda activate causalnex_env" >> $BASH_ENV
setup_requirements: &setup_requirements
name: Install PIP dependencies
command: |
echo "Python version: $(python --version 2>&1)"
pip install -r requirements.txt -U
pip install -r test_requirements.txt -U
conda install -y virtualenv
setup_pre_commit: &setup_pre_commit
name: Install pre-commit hooks
command: |
pre-commit install --install-hooks
pre-commit install --hook-type pre-push
linters: &linters
name: Run pylint and flake8
command: make lint

unit_tests: &unit_tests
name: Run tests
command: make test

build_docs: &build_docs
# NOTE: doesn't work on python 3.5
name: Build documentation
command: make build-docs

install_package: &install_package
name: Install the package
command: make install

unit_test_steps: &unit_test_steps
steps:
- checkout
- run: *prepare_container
- run: *activate_conda
- run: *setup_requirements
- run: *unit_tests

###############################################################################
jobs:
unit_tests_35:
docker: *python
environment:
PYTHON_VERSION: '3.5'
<<: *unit_test_steps

unit_tests_36:
docker: *python
environment:
PYTHON_VERSION: '3.6'
<<: *unit_test_steps

unit_tests_37:
environment:
PYTHON_VERSION: '3.7'
docker: *python
<<: *unit_test_steps

linters_37:
docker: *python
environment:
PYTHON_VERSION: '3.7'
steps:
- checkout
- run: *prepare_container
- run: *activate_conda
- run: *setup_requirements
- run: *setup_pre_commit
- run: *linters
- run: *install_package

docs:
docker: *python
environment:
PYTHON_VERSION: '3.7'
steps:
- checkout
- run: *prepare_container
- run: *activate_conda
- run: *setup_requirements
- run: *build_docs

all_circleci_checks_succeeded:
docker:
- image: circleci/python # any light-weight image
steps:
- run:
name: Success!
command: echo "All checks passed"

###############################################################################
workflows:
version: 2
regular:
jobs:
- unit_tests_35
- unit_tests_36
- unit_tests_37
- linters_37
- docs
- all_circleci_checks_succeeded:
requires:
- unit_tests_35
- unit_tests_36
- unit_tests_37
- linters_37
- docs
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[report]
fail_under=100
show_missing=True
exclude_lines =
pragma: no cover
raise NotImplementedError
8 changes: 8 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# copied from black

[flake8]
ignore = E203, E266, E501, W503
exclude = causalnex/bbn
max-line-length = 80
max-complexity = 18
select = B,C,E,F,W,T4,B9
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug report
about: If something isn't working
title: '<Title>'
labels: 'Issue: Bug Report'
assignees: ''

---

## Description
Short description of the problem here.

## Context
How has this bug affected you? What were you trying to accomplish?

## Steps to Reproduce
1. [First Step]
2. [Second Step]
3. [And so on...]

## Expected Result
Tell us what should happen.

## Actual Result
Tell us what happens instead.

```
-- If you received an error, place it here.
```

```
-- Separate them if you have more than one.
```

## Your Environment
Include as many relevant details about the environment in which you experienced the bug:

* CausalNex version used (`pip show causalnex`):
* Python version used (`python -V`):
* Operating system and version:
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Let us know if you have a feature request or enhancement
title: '<Title>'
labels: 'Issue: Feature Request'
assignees: ''

---

## Description
Is your feature request related to a problem? A clear and concise description of what the problem is: "I'm always frustrated when ..."

## Context
Why is this change important to you? How would you use it? How can it benefit other users?

## Possible Implementation
(Optional) Suggest an idea for implementing the addition or change.

## Possible Alternatives
(Optional) Describe any alternative solutions or features you've considered.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/thank-you.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Say thank you
about: Tell us how you use CausalNex and help us grow a community
title: '<Title>'
labels: 'Issue: Thank You'
assignees: ''

---

## Let us know
If you (or your company) are using CausalNex - please let us know. We'd love to hear from you!

## Making CausalNex even better
If you would like to help CausalNex - any of the following is greatly appreciated.

- [ ] Give the repository a star
- [ ] Help out with issues
- [ ] Review pull requests
- [ ] Blog about CausalNex
- [ ] Make tutorials
- [ ] Give talks
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Notice

- [ ] I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

- I submit this contribution under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0.txt) and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
- I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.
- I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.

## Motivation and Context
Why was this PR created?

## How has this been tested?
What testing strategies have you used?

## Checklist

- [ ] Read the [contributing](/CONTRIBUTING.md) guidelines
- [ ] Opened this PR as a 'Draft Pull Request' if it is work-in-progress
- [ ] Updated the documentation to reflect the code changes
- [ ] Added a description of this change and added my name to the list of supporting contributions in the [`RELEASE.md`](/RELEASE.md) file
- [ ] Added tests to cover my changes
- [ ] Assigned myself to the PR
132 changes: 132 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
##########################
# Common files

# IntelliJ
.idea/
*.iml
out/
.idea_modules/

### macOS
*.DS_Store
.AppleDouble
.LSOverride
.Trashes

# Vim
*~
.*.swo
.*.swp

# emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc

# vscode
.vscode/

# JIRA plugin
atlassian-ide-plugin.xml

# C extensions
*.so

### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
.static_storage/
.media/
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/tmp-build-artifacts
docs/build

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mkdocs documentation
/site

# mypy
.mypy_cache/
Loading

0 comments on commit 26bc8c6

Please sign in to comment.