forked from s_ranjbar/city_retrofit
34 lines
1021 B
Python
34 lines
1021 B
Python
"""
|
|
PhysicsFactory retrieve the specific physics module for the given region
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
"""
|
|
from physics.physics_feeders.us_new_york_city_physics_parameters import UsNewYorkCityPhysicsParameters
|
|
from physics.physics_feeders.us_physics_parameters import UsPhysicsParameters
|
|
|
|
|
|
class PhysicsFactory:
|
|
def __init__(self, handler, city, base_path='data/physics'):
|
|
self._handler = handler.lower().replace(' ', '_')
|
|
self._city = city
|
|
self._base_path = base_path
|
|
self.factory()
|
|
|
|
def us_new_york_city(self):
|
|
UsNewYorkCityPhysicsParameters(self._city, self._base_path)
|
|
|
|
def us(self):
|
|
UsPhysicsParameters(self._city, self._base_path)
|
|
|
|
def ca(self):
|
|
raise Exception('Not implemented')
|
|
|
|
def de(self):
|
|
raise Exception('Not implemented')
|
|
|
|
def es(self):
|
|
raise Exception('Not implemented')
|
|
|
|
def factory(self):
|
|
getattr(self, self._handler, lambda: None)()
|