Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.3.2'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements_dev.txt
- name: Test with pytest
run: |
python -m pytest
python -m pytest --cov=causalAssembly tests/
5 changes: 5 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
linters: linters_with_defaults(
line_length_linter = line_length_linter(120L),
object_name_linter = NULL,
indentation_linter = NULL
)
34 changes: 28 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
#Makefile for causalAssembly


MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))

VENV_NAME := venv_${CURRENT_DIR}
PYTHON=${VENV_NAME}/bin/python

ALLOWED_LICENSES := "$(shell tr -s '\n' ';' < allowed_licenses.txt)"
ALLOWED_PACKAGES := $(shell tr -s '\n' ' ' < allowed_packages.txt)

sync-venv:
: # Create or update default virtual environment to latest pinned
: # dependencies
test -d $(VENV_NAME) || \
python3.10 -m virtualenv $(VENV_NAME); \
${PYTHON} -m pip install -U pip; \
${PYTHON} -m pip install pip-tools
. $(VENV_NAME)/bin/activate && pip-sync requirements_dev.txt
#. $(VENV_NAME)/bin/activate && pip install --no-deps -e .
${PYTHON} -m pip install -U uv; \
. $(VENV_NAME)/bin/activate && uv pip sync requirements_dev.txt
. $(VENV_NAME)/bin/activate && uv pip install --no-deps -e .

requirements:
: # Update requirements_dev.txt if only new library is added
: # Assumes virtual environment with pip-tools installed is activated
pip-compile --extra dev -o requirements_dev.txt pyproject.toml --annotation-style line --no-emit-index-url --no-emit-trusted-host --allow-unsafe --resolver=backtracking
uv pip compile pyproject.toml --output-file=requirements.txt --annotation-style=line
uv pip compile pyproject.toml --extra=dev --output-file=requirements_dev.txt --annotation-style=line


update-requirements:
: # Update requirements_dev.txt if dependencies should be updated
: # Assumes virtual environment with pip-tools installed is activated
pip-compile --extra dev -o requirements_dev.txt pyproject.toml --annotation-style line --no-emit-index-url --no-emit-trusted-host --allow-unsafe --resolver=backtracking --upgrade
uv pip compile pyproject.toml --output-file=requirements.txt --annotation-style=line --upgrade
uv pip compile pyproject.toml --extra=dev --output-file=requirements_dev.txt --annotation-style=line --upgrade


precommit:
: # Run precommit on all files locally (this runs only the pre-commit and not the pre-push hooks)
pre-commit install
pre-commit run --all-files

test:
: # Run pytest
python -m pytest

licenses:
: # Create file with used licenses and check if these are permissive
pip-licenses --order=license --ignore-packages ${ALLOWED_PACKAGES} --allow-only=${ALLOWED_LICENSES} > licenses.txt

clean-branches:
git branch --merged | grep -v '\\*\\|main\\|develop' | xargs -n 1 -r git branch -d
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This repo provides details regarding $\texttt{causalAssembly}$, a causal discovery benchmark data tool based on complex production data.
Theoretical details and information regarding construction are presented in the [paper](https://arxiv.org/abs/2306.10816):

Göbler, K., Windisch, T., Pychynski, T., Sonntag, S., Roth, M., & Drton, M. causalAssembly: Generating Realistic Production Data for Benchmarking Causal Discovery, to appear in Proceedings of the 3rd Conference on Causal Learning and Reasoning (CLeaR), 2024,
Göbler, K., Windisch, T., Pychynski, T., Sonntag, S., Roth, M., & Drton, M. causalAssembly: Generating Realistic Production Data for Benchmarking Causal Discovery, to appear in Proceedings of the 3rd Conference on Causal Learning and Reasoning (CLeaR), 2024,
## Authors
* [Konstantin Goebler](mailto:[email protected])
* [Steffen Sonntag](mailto:[email protected])
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.3
1.2.0
24 changes: 24 additions & 0 deletions allowed_licenses.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Apache-2.0
Apache 2.0
Apache License 2.0
APACHE SOFTWARE LICENSE
BOSCH-INTERNAL
BSD 3-Clause
BSD License
BSD
3-Clause BSD License
BSD (3-Clause)
ISC
ISC License (ISCL)
Other/Proprietary License
MIT
MIT License
CMU License (MIT-CMU)
GPL-2.0-or-later
GNU General Public License v2 or later (GPLv2+)
Python Software Foundation License
The Unlicense (Unlicense)
Historical Permission Notice and Disclaimer (HPND)
MPL-2.0
NVIDIA Proprietary Software
UNKNOWN
8 changes: 8 additions & 0 deletions allowed_packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
causalAssembly
rpy2
chardet
certifi
dbx
mdpcommonlib
pathspec
text-unidecode
3 changes: 2 additions & 1 deletion benchmarks/run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Utility classes and functions related to causalAssembly.
"""Utility classes and functions related to causalAssembly.

Copyright (c) 2023 Robert Bosch GmbH

This program is free software: you can redistribute it and/or modify
Expand Down
Loading