This guide tries to give you solutions for the topics you may face, to have COLCA running suscessfully for you.
For Colca installation just follow these steps: :ref:`install_colca <installation_colca>`
For skforecast installation, just follow this step: :ref:`install_skforecast <installation_skforecast>`
For installating and configure MongoDB, just follow these steps: :ref:`install_mongodb <initialization_mongodb>`
For uvicorn installation and setup, just follow these steps: :ref:`install_uvicorn <initialization_uvicorn>`
For adding processes to the database:
(.venv) sascr/colca_services$ python3 -m add_processes
Now you have to complete the initial information for each process, one at a time:
SETTING UP FIRST PROCESS:
Select city name: >> Madrid
Select process name: >> Pump_Station_21
Select need items: >> aluminium, oil
Or you can pass a list of objects to add to the system:
(.venv) sascr/colca_services$ python3 -m add_processes <list_of_processes>
Each element of <list_of_processes> must be a python dictionary with the following key/value pattern:
city_name: str
co2_penalty: float
id_number: int
last_updated: datetime ISO format
name: str
needs_items: list of str
new_needs: bool
new_orders: bool
purchase_orders_made: bool
purchased_items: list of str
start_work: datetime ISO format
time_span: int
For removing processes to the database:
(.venv) sascr/colca_services$ python3 -m remove_processes <id_of_process>
Where <id_of_process> is the 'id-number' that you can find for each process info.
You can remove all processes from the database:
(.venv) sascr/colca_services$ python3 -m remove_processes -all
By specifying the all
option, all processes in the database will be removed.
To avoid accidental remove of processes, you need to confirm this operation:
YOU ARE GOING TO REMOVE ALL INFORMATION IN DATABASE
DO YOU WANT TO CONTINUE? PRESS 'Y' TO CONFIRM, ANY OTHER KEY TO CANCEL.
WARNING!! THIS OPERATION CANNOT BE UNDONE!
For setting up and run COLCA App, follow the next steps in order:
First run the
config
file:(.venv) sascr/colca_services$ python3 config_colca
You have to set the daily time for running COLCA App, press
enter
:Select daily time execution for COLCA: >> 9:00
For viewing data from the database, you can use the data-view
:
You have to select an
id_number
of a process:Select a process 'id_number' to access information: >> 3
You will be presented with the information on secreen as well as in XXX file:
EXTRACT OF PROCESS INFORMATION TAKEN FROM THE DATABASE (NOT AVAILABLE YET).
To perform the suite test for the source the code, from the root run pytest
:
(.venv) sascr/pytest
Updating COLCA...