Skip to content

ZEN-temple is the is the server that manages the solutions obtained through the ZEN-garden model and provides data via API

License

Notifications You must be signed in to change notification settings

ZEN-universe/ZEN-temple

Repository files navigation

ZEN Temple

ZEN Temple is a FastAPI Application.

Installation

Create a new conda environment, activate it, and install all dependencies:

conda create --name <your-env-name> python==3.12
conda activate <your-env-name>
pip install -e .

Then, create a new copy of .env.

cp .env.example .env

Modify the SOLUTION_FOLDER variable to the location of your solutions. This is the outputs folder generated by ZEN garden. Look at the page Running a model of the ZEN garden documentation.

Usage

Activate your conda environment and run the application with this command:

conda activate <your-env-name>
uvicorn src.zen_temple.main:app --reload

Folder structure

The folder and file structure is the following:

Explorer

explorer contains the html files for the frontend.

Warning

Do not edit the files in this folder. This folder is automatically generated by the frontend repository pipeline.

Models

models contains the Pydantic-models that are used for the documetnation. Some of these models also include generators that create an instance of the model given the path of a solution. See https://fastapi.tiangolo.com/tutorial/body/#create-your-data-model

Repositories

repositories contains the repositories for the data access. These provide an abstraction layer for the routers such that the data access is separtated from the data source. Arguably, the generators defined in the models should be part of the repository in order to separate the instanciation of the models from the way that the solutions are stored. For more information visit https://www.umlboard.com/design-patterns/repository.html

Routers

routers contains the FastAPI routers which define the different paths of the API server. For more information visit https://fastapi.tiangolo.com/tutorial/bigger-applications/

Config

config.py contains the config of the application.

Main

main.py contains the setup of the FastAPI application. For more information visit https://fastapi.tiangolo.com/tutorial/bigger-applications/

Releasing

In order to release a new version to Pypi you have to create a new tag in the correct semantic versioning form (i.e. v[0-9]+.[0-9]+.[0-9]+). Whenever such a tag is created, a new release is generated, the pyproject.toml file is updated and a new version is being published to Pypi.

About

ZEN-temple is the is the server that manages the solutions obtained through the ZEN-garden model and provides data via API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •