Skip to content

det-lab/TimeGAN-Static

Repository files navigation

TimeGAN

Release Build status codecov Commit activity License

A fork of https://github.com/jsyoon0823/TimeGAN that implements static features and snapshotting

Installing this Software

This package is available for install via pip: timegan · PyPI.

You will need a Python 3.9 - 3.11 environment to properly match versions with certain dependencies.

pip install timegan

Creating a Singularity Container

The timegan package is also equipped with a definition file that allows you to build a timegan training container with root.

After cloning the Repository, run the following command within the directory:

apptainer build 'envname'.sif env.def

You can test the build by checking timegan version install within the container. It should match the latest version on Github.

apptainer shell 'envname'.sif
pip list

This will also work if you are using singularity to build.

(For Developers)

Maintaining this repository will require a bit of setup.

Poetry
This repository was built using Poetry, its recommended for all of the management for this repository. You will need also this to commit changes to the repository.
  • Functions like "poetry show" will list all the dependencies for running timegan training.

  • More details about the use of Poetry for this repository can be found here (perhaps).

Pyenv
The main reason for using pyenv here is for setting up virtual environments. Using a virtual environment is ideal for testing and other tasks. I recommending checking the install tutorial by K0nze linked above.
  • Pyenv also allows for choosing which version of python you would like to use.

  • If preferred, you can accomplish the same things using Conda

Commit Changes (Linux)

First install Poetry, you can find more details for the install from this link.

sudo apt update -y
sudo apt install pipx
pipx install poetry

pipx ensurepath

You will need to set pipx locations to your PATH environment and restart your terminal session.

Committing changes without running a pre-check will result in build issues. To run a check, you will need pre-commit installed and able to access the Github hooks.

You cant do this as an apt install, or (recommended) via pip within a virtual environment. If you have issues with accessing the git Hooks, see: How to Set Up Pre-Commit Hooks | Stefanie Molin

apt install pre-commit
pre-commit install

Or install through a virtual environment (recommended):

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install pre-commit

From here, the hooks are built into the repository and can be set up by running:

pre-commit install

Pushing Commits

start by staging files to be committed.

Before pushing, run the command to resolve workflow errors:

git status
git add 'filename'
make check

If changes were made to your files, they will drop back down to the un-staged section when running "git status".

Then re-stage those files and push a commit:

git status # If you'd like to double check
git add 'filename'
make check # If you'd like to double check
git status # If you'd like to double check
git commit
git push

Whenever making changes to the package's code, be sure to update the version number in the pyproject.toml file.

You can upload new releases to Pypi via Poetry, or through Github. With poetry, you will need to configure your credentials, so I recommend drafting new releases through Github for simplicity.


Repository initiated with fpgmaas/cookiecutter-poetry.