Merge remote-tracking branch 'origin/update_documentation'
# Conflicts: # setup.py
50
hub/LINUX_INSTALL.md
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# LINUX_INSTALL
|
||||||
|
## Prepare your environment
|
||||||
|
### Install Miniconda
|
||||||
|
1. Get the link for the latest version of Miniconda from https://docs.conda.io/en/latest/miniconda.html
|
||||||
|
2. Download the installer using wget
|
||||||
|
````
|
||||||
|
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
||||||
|
````
|
||||||
|
3. Make the installer executable
|
||||||
|
````
|
||||||
|
chmod +x ./Miniconda3-latest-Linux-x86_64.sh
|
||||||
|
````
|
||||||
|
4. Run the installer
|
||||||
|
````
|
||||||
|
./Miniconda3-latest-Linux-x86_64.sh
|
||||||
|
````
|
||||||
|
5. Holder enter until you are prompted to accept the license terms. Enter yes.
|
||||||
|
6. Initialize the conda environment
|
||||||
|
````
|
||||||
|
conda init bash
|
||||||
|
````
|
||||||
|
7. Source .bashrc
|
||||||
|
````
|
||||||
|
source ~/.bashrc
|
||||||
|
````
|
||||||
|
8. Create a conda environment for the hub
|
||||||
|
````
|
||||||
|
conda create --name hub python=3.9.16
|
||||||
|
````
|
||||||
|
|
||||||
|
### Setup SRA
|
||||||
|
1. Get the sra binary and libshortwave.so library from Guille or Koa
|
||||||
|
2. Place the binary and the library into your directory of choice
|
||||||
|
3. Make a symlink for the binary and place it into /usr/local/bin/sra
|
||||||
|
````
|
||||||
|
sudo ln -s ~/sra /usr/local/bin/sra
|
||||||
|
````
|
||||||
|
4. Make a symlink for the library and place it into /usr/local/lib/libshortwave.so
|
||||||
|
````
|
||||||
|
sudo ln -s ~/libshortwave.so /usr/local/lib/libshortwave.so
|
||||||
|
````
|
||||||
|
### Setup INSEL
|
||||||
|
1. TBD
|
||||||
|
|
||||||
|
### Get a Python editor
|
||||||
|
You are welcome to use the Python editor of your preference. The CERC team generally uses PyCharm to develop the hub.
|
||||||
|
The latest version of PyCharm can be downloaded from [JetBrains website](https://www.jetbrains.com/pycharm/promo/?source=google&medium=cpc&campaign=14127625109&term=pycharm&content=536947779504&gad=1&gclid=CjwKCAjw0ZiiBhBKEiwA4PT9z2AxPfy39x_RcBqlYxJ6sm_s55T9qvA_sZ8ZfkhIVX6FOD-ySbmzARoCcpQQAvD_BwE).
|
||||||
|
For setup and installation instructions, please view the "Get a Python Editor"
|
||||||
|
from the [WINDOWS_INSTALL](https://nextgenerations-cities.encs.concordia.ca/gitea/CERC/hub/src/branch/main/hub/WINDOWS_INSTALL.md)
|
||||||
|
documentation.
|
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
This is an installation guide for Windows, covering all the steps needed to begin developing code for the Urban
|
This is an installation guide for Windows, covering all the steps needed to begin developing code for the Urban
|
||||||
Simulation Platform 'Hub'. At the end of this process you will have installed and configured all the necessary applications,
|
Simulation Platform 'Hub'. At the end of this process you will have installed and configured all the necessary applications,
|
||||||
set up your own project on CERC's Gitlab and created your first python file.
|
set up your own project on CERC's Gitea and created your first python file.
|
||||||
|
|
||||||
## Prepare your environment
|
## Prepare your environment
|
||||||
g
|
|
||||||
To develop any new code for the Urban Simulation Platform you must have the right software applications installed and configured.
|
To develop any new code for the Urban Simulation Platform you must have the right software applications installed and configured.
|
||||||
The Platform is written in python and so the applications you need are:
|
The Platform is written in python and so the applications you need are:
|
||||||
* Miniconda
|
* Miniconda
|
||||||
|
* SRA Files
|
||||||
* Python Editor
|
* Python Editor
|
||||||
|
|
||||||
You also need to register a user account with the CERC's code repository on Gitlab and have the necessary permissions for
|
You also need to register a user account with the CERC's code repository on Gitea and have the necessary permissions for
|
||||||
creating new code. For that purpose, please, contact Guillermo (guillermo.gutierrezmorote@concordia.ca) or
|
creating new code. For that purpose, please, contact Guillermo (guillermo.gutierrezmorote@concordia.ca) or
|
||||||
Koa (kekoa.wells@concordia.ca) as soon as possible.
|
Koa (kekoa.wells@concordia.ca) as soon as possible.
|
||||||
|
|
||||||
@ -47,6 +47,29 @@ _The term '...' is not recognized as the name of a cmdlet, function,..._
|
|||||||
|
|
||||||
To solve it, type 'Set-ExecutionPolicy Unrestricted' as shown in the image.
|
To solve it, type 'Set-ExecutionPolicy Unrestricted' as shown in the image.
|
||||||
|
|
||||||
|
### Setup SRA
|
||||||
|
|
||||||
|
1. Get the SRA executable and dll files from Guille or Koa
|
||||||
|
2. Create a folder in "C:\Program Files\" called "sra"
|
||||||
|
|
||||||
|
![create_sra](docs/img_windows_install/img_34.png)
|
||||||
|
|
||||||
|
3. Copy shortwave_integer.exe and pthreadGC2.dll into the sra folder.
|
||||||
|
|
||||||
|
![create_sra](docs/img_windows_install/img_35.png)
|
||||||
|
|
||||||
|
4. Add the newly created sra folder to the Path, similar to step 2 from the Miniconda setup above.
|
||||||
|
|
||||||
|
![create_sra](docs/img_windows_install/img_36.png)
|
||||||
|
|
||||||
|
### Install and setup INSEL
|
||||||
|
|
||||||
|
1. Get the INSEL installer from Guille or Koa
|
||||||
|
2. Run the installer to completion using the default installation path
|
||||||
|
3. Add the INSEL installation folder to the Path
|
||||||
|
|
||||||
|
![create_sra](docs/img_windows_install/img_41.png)
|
||||||
|
|
||||||
### Get a Python editor
|
### Get a Python editor
|
||||||
|
|
||||||
1. You will need a python editor in order to import the existing Hub source code and to write your own python code.
|
1. You will need a python editor in order to import the existing Hub source code and to write your own python code.
|
||||||
@ -55,7 +78,7 @@ an excellent open-source python editor.
|
|||||||
2. Run the installer, and follow the installation instructions for PyCharm, you may change a few options,
|
2. Run the installer, and follow the installation instructions for PyCharm, you may change a few options,
|
||||||
but the default ones should be fine.
|
but the default ones should be fine.
|
||||||
|
|
||||||
**NOTE:** If Pycharm asks you to create a Virtual Environment, click **Cancel**. You will do it later using Conda instead.
|
**NOTE:** If PyCharm asks you to create a Virtual Environment, click **Cancel**. You will do it later using Conda instead.
|
||||||
|
|
||||||
![creating_virtual_environment](docs/img_windows_install/img_31.png)
|
![creating_virtual_environment](docs/img_windows_install/img_31.png)
|
||||||
|
|
||||||
@ -70,14 +93,12 @@ You can find it also at **Git->Clone...**
|
|||||||
|
|
||||||
![pycharm get from version control](docs/img_windows_install/img_6.png)
|
![pycharm get from version control](docs/img_windows_install/img_6.png)
|
||||||
|
|
||||||
3. Select **Git** as the **Version control**. For the URL use the link to the Hub repository, as seen below.
|
3. Select **Git** as the **Version control**. Open the [hub repository](https://nextgenerations-cities.encs.concordia.ca/gitea/CERC/hub)
|
||||||
|
on Gitea and copy the URL from your browser to use as the URL inside PyCharm.
|
||||||
|
|
||||||
![pycharm get from version control screen](docs/img_windows_install/img_1.png)
|
![pycharm get from version control screen](docs/img_windows_install/img_1.png)
|
||||||
|
|
||||||
(You can also copy this URL by going to the Hub repository in [Gitlab](https://rs-loy-gitlab.concordia.ca/Guille/hub.git)
|
![gitea get https](docs/img_windows_install/img_39.png)
|
||||||
and clicking on the **Copy URL** button, next to **Clone with HTTPS**)
|
|
||||||
|
|
||||||
![gitlab get https](docs/img_windows_install/img_17.png)
|
|
||||||
|
|
||||||
The Directory to store the Hub source code locally is automatically created for you. Edit this if you prefer it to be stored somewhere else.
|
The Directory to store the Hub source code locally is automatically created for you. Edit this if you prefer it to be stored somewhere else.
|
||||||
|
|
||||||
@ -152,7 +173,7 @@ _lca_classes_,... And, click on the **Create** button.
|
|||||||
3. Click on the **Git** button in the bottom-left corner to pop-up the window showing the Git information.
|
3. Click on the **Git** button in the bottom-left corner to pop-up the window showing the Git information.
|
||||||
See your new branch has been created under _Local_.
|
See your new branch has been created under _Local_.
|
||||||
|
|
||||||
4. Now we need to let the CERC Gitlab repository know about this new branch. You do this by right-clicking on
|
4. Now we need to let the CERC Gitea repository know about this new branch. You do this by right-clicking on
|
||||||
your branch and selecting **Push...** from the drop-down menu.
|
your branch and selecting **Push...** from the drop-down menu.
|
||||||
|
|
||||||
5. Then click on the **Push** button at the bottom-right of the **Push Commits** window.
|
5. Then click on the **Push** button at the bottom-right of the **Push Commits** window.
|
||||||
@ -180,33 +201,35 @@ See the picture below.
|
|||||||
|
|
||||||
![pycharm configuration screen](docs/img_windows_install/img_5.png)
|
![pycharm configuration screen](docs/img_windows_install/img_5.png)
|
||||||
|
|
||||||
## Set up a new project on Gitlab
|
## Set up a new project on Gitea
|
||||||
|
You will need an account before you can access the Gitea. Please contact Guillermo (guillermo.gutierrezmorote@concordia.ca) or
|
||||||
|
Koa (kekoa.wells@concordia.ca) to request an account.
|
||||||
|
|
||||||
1. Open a browser and to the [CERC Git](https://rs-loy-gitlab.concordia.ca/). Click on the blue **New project** button.
|
1. Open a browser and go to the [CERC Gitea](https://nextgenerations-cities.encs.concordia.ca/). Click on the **+** in the top right
|
||||||
|
and select "New Repository" or press the **+** below the Organization tab.
|
||||||
|
|
||||||
![git new project screen](docs/img_windows_install/img_14.png)
|
![git new project screen](docs/img_windows_install/img_37.png)
|
||||||
|
|
||||||
2. Choose the **Create blank project** option from the three options seen below.
|
2. Choose the **Create blank project** option from the three options seen below.
|
||||||
|
|
||||||
3. Type in a name that describes your project: _hp_workflow_, _bus_system_optimization_...
|
3. Type in a name that describes your project: _hp_workflow_, _bus_system_optimization_...
|
||||||
(remember to follow the CERC naming conventions described in the [Coding Style](PYGUIDE.md)).
|
(remember to follow the CERC naming conventions described in the [Coding Style](PYGUIDE.md)).
|
||||||
Check the option **Initialize repository with a README**, and ideally, check the **Visibility Level** to be **Public**.
|
Ideally, uncheck the option **Make Repository Private**, and check the **Initialize Repository**
|
||||||
Then click on the **Create project** button.
|
Then click on the **Create project** button.
|
||||||
|
|
||||||
![git give a name](docs/img_windows_install/img_15.png)
|
![git give a name](docs/img_windows_install/img_38.png)
|
||||||
|
|
||||||
You should then see a confirmation screen with all the information about your new project.
|
You should then see a confirmation screen with all the information about your new project.
|
||||||
|
|
||||||
## Get your project into Pycharm
|
## Get your project into Pycharm
|
||||||
|
|
||||||
1. Now you can make a clone of this project, within PyCharm. First, copy the URL by clicking on the blue **Clone** button
|
1. Now you can make a clone of this project, within PyCharm. First, go to the page of your repository on the Gitea and copy the URL.
|
||||||
and then click on the **Copy URL** button, next to the **Clone with HTTPS** link.
|
|
||||||
|
|
||||||
2. Switch back to PyCharm and close the Hub project by choosing **File->Close Project**. You will then see the
|
2. Switch back to PyCharm and close the Hub project by choosing **File->Close Project**. You will then see the
|
||||||
**Welcome To PyCharm** window again.
|
**Welcome To PyCharm** window again.
|
||||||
|
|
||||||
3. Clone a copy of your Project into PyCharm, following the steps 2-6 of the _GET THE CERC HUB SOURCE CODE_
|
3. Clone a copy of your Project into PyCharm, following the steps 2-6 of the _GET THE CERC HUB SOURCE CODE_
|
||||||
section above, but using the URL link that you just copied for your gitlab project.
|
section above, but using the URL link that you just copied for your Gitea project.
|
||||||
|
|
||||||
4. Select **File->Settings** to open the **Settings** window. From the panel on the left click on
|
4. Select **File->Settings** to open the **Settings** window. From the panel on the left click on
|
||||||
**Project:<project name> -> Project Structure**.
|
**Project:<project name> -> Project Structure**.
|
||||||
@ -242,5 +265,5 @@ city = GeometryFactory('citygml', path='myfile.gml').city
|
|||||||
|
|
||||||
9. Always remember to push your own project changes as the last thing you do before ending your working day!
|
9. Always remember to push your own project changes as the last thing you do before ending your working day!
|
||||||
First, commit your changes by clicking on the green check in the top-right corner of Pycharm. Add a comment that explains briefly your changes.
|
First, commit your changes by clicking on the green check in the top-right corner of Pycharm. Add a comment that explains briefly your changes.
|
||||||
Then, pull by clicking on the blue arrow to be sure that there are no conflicts between your version (local) and the remote one (gitlab).
|
Then, pull by clicking on the blue arrow to be sure that there are no conflicts between your version (local) and the remote one (Gitea).
|
||||||
Once the conflicts are solved and the merge in local is done, push the changes by clicking on the green arrow.
|
Once the conflicts are solved and the merge in local is done, push the changes by clicking on the green arrow.
|
||||||
|
BIN
hub/docs/img_windows_install/img_34.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
hub/docs/img_windows_install/img_35.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
hub/docs/img_windows_install/img_36.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
hub/docs/img_windows_install/img_37.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
hub/docs/img_windows_install/img_38.png
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
hub/docs/img_windows_install/img_39.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
hub/docs/img_windows_install/img_40.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
hub/docs/img_windows_install/img_41.png
Normal file
After Width: | Height: | Size: 23 KiB |
25
setup.py
@ -18,24 +18,22 @@ with open(version) as f:
|
|||||||
exec(f.read(), main_ns)
|
exec(f.read(), main_ns)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='cerc-hub',
|
name='cerc-hub',
|
||||||
version=main_ns['__version__'],
|
version=main_ns['__version__'],
|
||||||
description="CERC Hub consist in a set of classes (Central data model), importers and exporters to help researchers "
|
description="CERC Hub consist of a set of classes (Central data model), importers and exporters to help researchers "
|
||||||
"to create better and sustainable cities",
|
"to create better and more sustainable cities",
|
||||||
long_description="CERC Hub consist in a set of classes (Central data model), importers and exporters to help "
|
long_description="CERC Hub consist of a set of classes (Central data model), importers and exporters to help "
|
||||||
"researchers to create better and sustainable cities.\n\nDevelop at Concordia university in canada "
|
"researchers to create better and more sustainable cities.\n\nDeveloped at Concordia university in Canada "
|
||||||
"as part of the research group from the next generation cities institute our aim among others it's "
|
"as part of the research group from the Next Generation Cities Institute, our aim among others is "
|
||||||
"to provide a comprehensive set of tools to help researchers and urban developers to make decisions "
|
"to provide a comprehensive set of tools to help researchers and urban developers to make decisions "
|
||||||
"to improve the livability and efficiency of our cities",
|
"to improve the livability and efficiency of our cities",
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
|
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
],
|
],
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
packages=['hub',
|
packages=['hub',
|
||||||
'hub.catalog_factories',
|
'hub.catalog_factories',
|
||||||
'hub.catalog_factories.construction',
|
'hub.catalog_factories.construction',
|
||||||
@ -88,7 +86,8 @@ setup(
|
|||||||
data_files=[
|
data_files=[
|
||||||
('hub', glob.glob('requirements.txt')),
|
('hub', glob.glob('requirements.txt')),
|
||||||
('hub/config', glob.glob('hub/config/*.ini')),
|
('hub/config', glob.glob('hub/config/*.ini')),
|
||||||
('hub/catalog_factories/greenery/ecore_greenery', glob.glob('hub/catalog_factories/greenery/ecore_greenery/*.ecore')),
|
('hub/catalog_factories/greenery/ecore_greenery',
|
||||||
|
glob.glob('hub/catalog_factories/greenery/ecore_greenery/*.ecore')),
|
||||||
('hub/data/construction', glob.glob('hub/data/construction/*')),
|
('hub/data/construction', glob.glob('hub/data/construction/*')),
|
||||||
('hub/data/costs', glob.glob('hub/data/costs/montreal_costs.xml')),
|
('hub/data/costs', glob.glob('hub/data/costs/montreal_costs.xml')),
|
||||||
('hub/data/customized_imports', glob.glob('hub/data/customized_imports/ashrae_archetypes.xml')),
|
('hub/data/customized_imports', glob.glob('hub/data/customized_imports/ashrae_archetypes.xml')),
|
||||||
|