Giter Club home page Giter Club logo

simulation_case_study's Introduction

Blackrock Case Study Project

This repository contains a FastAPI application that exposes an API endpoint for simulating the discrete time dynamical system to approximate the point's position. The simulation parameters are provided in the request payload.

Installation

Pre-Installation:

Before installing the simulation application, you need to have the following installed:

  1. Python 3.7 or above - check by typing python -V. If the output does not start with 3.7 or greater, you need to install a later version of Python. Using pyenv is highly recommended!

  2. Homebrew if you are developing on a Mac.

  3. The AWS Command Line Interface - check by typing aws --version. The output should start with aws-cli/2.4.2 - if it does not, you need to install AWS CLI.

Installation: Clone the Repo:

$ git clone https://github.com/Lin-Wen15/simulation_case_study.git
$ cd simulation_case_study/backend
$ python -m venv .br-venv
$ source .br-venv/bin/activate (On Windows: `.venv\Scripts\activate`)
$ pip install -r requirements.txt
$ pip install fastapi

Usage:

  • Navigate to the backend/ directory: cd simulation_case_study-root/backend
  • Run the simulation application on the local server: uvicorn main:app --reload
  • On a new terminal, submit your POST request. Here's an example curl command with input parameters, you can change the parameters with the same JSON playload:
curl -X POST "http://127.0.0.1:8000/simulations/simulate" -H "Content-Type: application/json" -d '{"x0": 1.0, "y0": 2.0, "z0": 3.0, "sigma": 0.5, "rho": 0.8, "beta": 0.2, "delta_t": 0.01, "n": 20}'
  • You can check the detailed information about the available endpoints, request parameters, and response formats at http://127.0.0.1:8000/docs while the server is running.

Infrastructure and Deploy Application on ECS:

  • Navigate to the infrastructure/ directory.
  • Install Terraform and AWS CLI: brew install terraform (On Windows: choco install terraform)
  • Run the Terraform Commands:
terraform init
terraform plan -var="aws_access_key=your-access-key" -var="aws_secret_key=your-secret-key"
terraform apply -var="aws_access_key=your-access-key" -var="aws_secret_key=your-secret-key"

Run unittests:

cd simulation_case_study/backend
python -m unittest tests.test_simulation

Notes:

  • The simulate_system function in dynamical_simulation.py contains the logic for simulating the dynamical system.

simulation_case_study's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.