diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..8624131 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +source .venv/bin/activate diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bda312d --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +include *.mk + +# add additional targets here diff --git a/Makefile-common.mk b/Makefile-common.mk new file mode 100644 index 0000000..5e5bc91 --- /dev/null +++ b/Makefile-common.mk @@ -0,0 +1,37 @@ +MAKEFLAGS += --warn-undefined-variables +SHELL = /bin/bash -o pipefail +.DEFAULT_GOAL := help +.PHONY: help install clean clean-env + +## display help message +help: + @awk '/^##.*$$/,/^[~\/\.0-9a-zA-Z_-]+:/' $(MAKEFILE_LIST) | awk '!(NR%2){print $$0p}{p=$$0}' | awk 'BEGIN {FS = ":.*?##"}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' | sort + +venv ?= .venv +pip := $(venv)/bin/pip + +$(pip): .python-version +# create venv using system python even when another venv is active + PATH=$${PATH#$${VIRTUAL_ENV}/bin:} python3 -m venv --clear $(venv) + $(venv)/bin/python --version + +$(venv): requirements.txt $(pip) + $(pip) install -r requirements.txt + $(pip) install -e . + $(pip) install -U lbforaging rware + touch $(venv) + +## delete the venv +clean-env: + rm -rf $(venv) + +## clean pycache and log files +clean: + @echo "Cleaning up log files, __pycache__ folders, and .pyc files..." + find . -name '*.log' -type f -delete + find . -name '__pycache__' -type d -exec rm -r {} + + find . -name '*.pyc' -type f -delete + @echo "Cleanup complete." + +## create venv and install this package +install: $(venv) diff --git a/requirements.txt b/requirements.txt index 9ae4c44..662e40f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,12 @@ hydra-submitit-launcher==1.2.0 hydra-ax-sweeper==1.1.5 imageio==2.9.0 munch==2.5.0 +numpy==1.19.5 +scipy==1.10.1 +matplotlib==3.6.3 +gym==0.21.0 +contourpy==1.1.1 pandas==1.2.4 -pytorch==1.8.* +torch==1.8.* pyyaml==5.4.1 stable-baselines3[extra]>=0.11.0,<=1.1.0a3