Skip to content
Open
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source .venv/bin/activate
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include *.mk

# add additional targets here
37 changes: 37 additions & 0 deletions Makefile-common.mk
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 6 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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