Skip to content

Commit

Permalink
Minor updates advances #2
Browse files Browse the repository at this point in the history
  • Loading branch information
pab1s committed Jul 15, 2024
1 parent 7e8346f commit 10fd936
Show file tree
Hide file tree
Showing 4 changed files with 345 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
auto-update-conda: true
environment-file: environment.yaml
activate-environment: tda-nn-separability
activate-environment: tda-nn-analysis
python-version: 3.10.14
channels: conda-forge

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ data/
*.xlsx

# Outputs
outputs/*
outputs/checkpoints/*.pth
outputs/figures/*.png
logs/
Expand Down
30 changes: 14 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Enhanced Makefile for managing the Conda environment tda-nn-separability
# Makefile for managing the Conda environment tda-nn-analysis

# Parameters
ENV_NAME := tda-nn-separability
ENV_NAME := tda-nn-analysis
PYTHON_VERSION := 3.10
ENV_FILE := environment.yaml

Expand All @@ -18,15 +18,14 @@ init:
ifndef CONDA
$(error "conda is not available, please install Miniconda or Anaconda.")
endif
@echo "Creating the Conda environment if it doesn't exist..."
@conda env list | grep -q '^$(ENV_NAME) ' || \
conda create --yes --name $(ENV_NAME) python=$(PYTHON_VERSION)
echo "Creating the Conda environment if it doesn't exist..."
conda env list | grep -q '^$(ENV_NAME) ' || conda create --yes --name $(ENV_NAME) python=$(PYTHON_VERSION)

# Install packages from an environment file or manually specified
.PHONY: install
install: init
@echo "Installing necessary packages into the Conda environment..."
@if [ -f "$(ENV_FILE)" ]; then \
echo "Installing necessary packages into the Conda environment..."
if [ -f "$(ENV_FILE)" ]; then \
echo "Using $(ENV_FILE) to install packages..."; \
conda env update --name $(ENV_NAME) --file $(ENV_FILE) --prune; \
else \
Expand All @@ -37,25 +36,24 @@ install: init
# Export the current environment to a YAML file, excluding build-specific fields
.PHONY: export
export:
@echo "Exporting the Conda environment to $(ENV_FILE)..."
@conda env export --name $(ENV_NAME) --no-builds | grep -v "^name: " > $(ENV_FILE)
echo "Exporting the Conda environment to $(ENV_FILE)..."
conda env export --name $(ENV_NAME) --no-builds | grep -v "^name: " > $(ENV_FILE)

# Update all packages in the Conda environment
.PHONY: update
update: init
@echo "Updating all packages in the Conda environment..."
@conda run --name $(ENV_NAME) conda update --all --yes
echo "Updating all packages in the Conda environment..."
conda run --name $(ENV_NAME) conda update --all --yes

# Run tests using pytest within the Conda environment
.PHONY: test
test: init
@echo "Running tests..."
echo "Running tests..."
pytest tests -v

# Clean up __pycache__ directories and *.pyc files
.PHONY: clean
clean:
@echo "Cleaning up __pycache__ directories and *.pyc files..."
@find . -type d -name "__pycache__" -exec rm -rf {} + > /dev/null 2>&1
@find . -type f -name "*.pyc" -delete > /dev/null 2>&1

echo "Cleaning up __pycache__ directories and *.pyc files..."
find . -type d -name "__pycache__" -exec rm -rf {} + > /dev/null 2>&1
find . -type f -name "*.pyc" -delete > /dev/null 2>&1
Loading

0 comments on commit 10fd936

Please sign in to comment.