Skip to content

Commit 9a15809

Browse files
committed
update setup.py and add installation docs
1 parent e77a8b9 commit 9a15809

File tree

4 files changed

+133
-37
lines changed

4 files changed

+133
-37
lines changed

docs/source/docker-structure.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(docker_structure)=
12
# Docker image structure
23
As we implemented different plugins for each simulation we provide different
34
docker images for. To simplify development we split images into `env.`

docs/source/first-steps.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,45 @@
11
(First_steps)=
2+
23
# First steps
34

45
You can either use bim2sim directly from console or include it in your scripts.
56

67
## Console
8+
79
Start your favorite console and type
10+
811
```
912
$ python bim2sim -h
1013
```
14+
1115
to see all available commands.
1216

1317
Now it's time to create your first project with bim2sim.
18+
1419
```
1520
$ python bim2sim project create path/to/project -s teaser
1621
```
17-
will create a new project folder at `path/to/project` and set it up for a simulation with [TEASER](teaser) (see [](plugins) for more options).
18-
Now open the newly created project folder and put the *.ifc file you wish to process into the subfolder `ifc`. Alternatively you could add the option `-i path/to/ifc` to the command above, which would copy the ifc for you.
22+
23+
will create a new project folder at `path/to/project` and set it up for a
24+
simulation with [TEASER](teaser) (see [](plugins) for more options).
25+
Now open the newly created project folder and put the *.ifc file you wish to
26+
process into the subfolder `ifc`. Alternatively you could add the
27+
option `-i path/to/ifc` to the command above, which would copy the ifc for you.
1928

2029
If all is set up correctly, run
30+
2131
```
2232
$ python bim2sim load path/to/project
2333
```
24-
to load and run an existing project. Then follow the instructions from your console.
25-
When you are done, you can inspect the results from the `/results` folder of your project.
2634

35+
to load and run an existing project. Then follow the instructions from your
36+
console. When you are done, you can inspect the results from the `/results` folder of
37+
your project.
2738

2839
## Script
2940

3041
To include bim2sim in your scripts start with something like this:
42+
3143
```python
3244
from bim2sim import Project
3345
from bim2sim.log import default_logging_setup
@@ -44,7 +56,9 @@ else:
4456
# else create a new one
4557
project = Project.create(project_path, ifc_path, 'teaser')
4658
```
59+
4760
now you have multiple options to run the project and handle it's decisions:
61+
4862
```python
4963
# Option 1: handle decisions manually
5064
for bunch in project.run():
@@ -58,4 +72,10 @@ run_project(project, ConsoleDecisionHandler())
5872

5973
# Option 3: write your own DecisionHandler and use it as in Option 2
6074
```
61-
Details about [DecisionHandlers](DecisionHandler).
75+
76+
Details about [DecisionHandlers](DecisionHandler).
77+
78+
## Examples
79+
80+
Please have also a look at `bim2sim/examples` which provide you some runnable
81+
examples for PluginTEASER, PluginEnergyPlus and PluginLCA.

docs/source/installation.md

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,58 @@
11
# Installation
22

3-
## Anaconda
4-
As some requirements for inbuilt plugins of bim2sim are not available via PyPi
5-
but only via Anaconda, the best way to install bim2sim is using conda.
3+
## Base Library
64

7-
`conda install bim2sim -c # todo`
5+
As some requirements for core functionality of `bim2sim` are not available via
6+
PyPi but only via Anaconda an installation only via PyPi is sadly not possible
7+
for now.
8+
For now the easiest way to install `bim2sim` is the following:
89

9-
if all worked well you should be able to start using bim2sim. Try
10+
```
11+
# create fresh python environment with conda
12+
conda create -n bim2sim python=3.9
13+
14+
# activate your environment
15+
conda activate bim2sim
16+
17+
# clone bim2sim repository (you can also use SSH if you prefer)
18+
git clone https://github.com/BIM2SIM/bim2sim.git
19+
cd bim2sim
20+
21+
# go into main directory of the repo where setup.py is stored and run
22+
python setup.py install
23+
24+
# afterwards install the packages which are installable via pip
25+
conda install -c conda-forge pythonocc-core=7.6.2 -y
26+
conda install -c conda-forge ifcopenshell -y
27+
```
28+
29+
If all worked well you should be able to start using bim2sim. Try
1030

1131
`python bim2sim -h`
1232

13-
to see all available commands. For further reading see [](First_steps).
33+
We will improve this process by our own anaconda image soon.
34+
35+
## Plugins
36+
37+
To use the Plugins you have to install the requirements of the corresponding
38+
plugins. Therefore just go the Plugin folder you want to use under
39+
`bim2sim/plugins/` and run
40+
41+
```
42+
pip install -r requirements.txt
43+
```
44+
45+
to see all available commands. For further reading see
46+
[First Steps](First_steps).
47+
1448

1549
## Docker
16-
tbd
50+
51+
We already create docker images for each the base `bim2sim` tool as for every
52+
Plugin, but currently these are only available through our own registry. You can
53+
still build the images yourself based on the existing Dockerfiles. As our
54+
current structure is a bit complicated, please have a look at the explanation of
55+
the [Docker Structure](docker_structure).
56+
57+
We will release the images on DockerHub soon to make them accessible for
58+
everyone (see [issuue 452](https://github.com/BIM2SIM/bim2sim/issues/452)).

setup.py

Lines changed: 58 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,74 @@
11
from setuptools import setup, find_packages
2-
import glob
3-
4-
5-
data_files = []
6-
directories = glob.glob('bim2sim\\assets\\')
7-
for directory in directories:
8-
files = glob.glob(directory + '*')
9-
data_files.append((directory, files))
102

113
with open("README.md", 'r') as f:
124
long_description = f.read()
5+
with open("requirements.txt", 'r') as f:
6+
required = f.read().splitlines()
7+
VERSION = "0.1.0"
8+
139

1410
setup(
1511
name='bim2sim',
16-
version='0.1.dev0',
12+
version=VERSION,
1713
description='Create simulation models from IFC files',
18-
license="???",
14+
license="LICENSE",
1915
long_description=long_description,
2016
long_description_content_type='text/markdown',
2117
author='BIM2SIM',
22-
author_email='???',
23-
url="???",
24-
packages=find_packages() + ['bim2sim.assets', 'bim2sim.backends'],
18+
author_email='[email protected]',
19+
url="https://github.com/BIM2SIM/bim2sim",
20+
packages=find_packages(include=['bim2sim*']),
2521
include_package_data=True,
26-
data_files=data_files,
27-
# package_data={'': ['assets/*.*']},
28-
python_requires='>=3.6.0',
29-
install_requires=[
30-
'docopt', 'numpy', 'python-dateutil',
31-
'mako', 'networkx>=2.2', 'pint'
32-
], # external packages as dependencies
33-
extras_require={
34-
'manual_install': ['ifcopenshell>=0.6'],
35-
'plotting': ['matplotlib'],
36-
'communication': ['rpyc'],
22+
data_files = [('bim2sim\\assets\\enrichment\\hvac', ['bim2sim\\assets\\enrichment\\hvac\\TypeBuildingElements.json']),
23+
('bim2sim\\assets\\enrichment\\material', ['bim2sim\\assets\\enrichment\\material\\MaterialTemplates.json',
24+
'bim2sim\\assets\\enrichment\\material\\TypeBuildingElements.json']),
25+
('bim2sim\\assets\\enrichment\\usage', ['bim2sim\\assets\\enrichment\\usage\\commonUsages.json',
26+
'bim2sim\\assets\\enrichment\\usage\\customUsages.json',
27+
'bim2sim\\assets\\enrichment\\usage\\customUsagesAC20-FZK-Haus_with_SB55.json',
28+
'bim2sim\\assets\\enrichment\\usage\\customUsagesAC20-Institute-Var-2_with_SB-1-0.json',
29+
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_fixed002.json',
30+
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_with_SB_neu.json',
31+
'bim2sim\\assets\\enrichment\\usage\\customUsagesAC20-Institute-Var-2_with_SB-1-0.json',
32+
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_fixed002.json',
33+
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_with_SB_neu.json',
34+
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_with_SB88.json',
35+
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_with_SB89.json',
36+
'bim2sim\\assets\\enrichment\\usage\\customUsagesKIT-EDC_with_SB.json',
37+
'bim2sim\\assets\\enrichment\\usage\\UseConditions.json',
38+
'bim2sim\\assets\\enrichment\\usage\\UseConditionsFM_ARC_DigitalHub_fixed002.json',
39+
'bim2sim\\assets\\enrichment\\usage\\UseConditionsFM_ARC_DigitalHub_with_SB_neu.json',
40+
'bim2sim\\assets\\enrichment\\usage\\UseConditionsFM_ARC_DigitalHub_with_SB89.json']),
41+
('bim2sim\\assets\\finder', ['bim2sim\\assets\\finder\\template_ArchiCAD.json',
42+
'bim2sim\\assets\\finder\\template_Autodesk Revit.json',
43+
'bim2sim\\assets\\finder\\template_LuArtX_Carf.json',
44+
'bim2sim\\assets\\finder\\template_TRICAD-MS.json']),
45+
46+
47+
('bim2sim\\assets\\templates\\check_ifc', ['bim2sim\\assets\\templates\\check_ifc\\inst_template',
48+
'bim2sim\\assets\\templates\\check_ifc\\prop_template',
49+
'bim2sim\\assets\\templates\\check_ifc\\summary_template']),
50+
('bim2sim\\assets\\templates\\modelica', ['bim2sim\\assets\\templates\\modelica\\tmplModel.txt']),
51+
('bim2sim\\assets\\weatherfiles', ['bim2sim\\assets\\weatherfiles\\DEU_NW_Aachen.105010_TMYx.epw',
52+
'bim2sim\\assets\\weatherfiles\\DEU_NW_Aachen.105010_TMYx.mos']),
53+
('bim2sim\\assets\\ifc_example_files', ['bim2sim\\assets\\ifc_example_files\\AC20-FZK-Haus.ifc',
54+
'bim2sim\\assets\\ifc_example_files\\ERC_EBC_mainbuilding.ifc',
55+
'bim2sim\\assets\\ifc_example_files\\hvac_heating.ifc' ])
56+
57+
],
58+
59+
package_data={'': ['bim2sim/assets/*.*']},
60+
python_requires='>=3.8.*,<3.10.*',
61+
install_requires=[required
62+
],
63+
64+
classifiers=[
65+
'Programming Language :: Python :: 3.8',
66+
'Programming Language :: Python :: 3.9',
67+
],
68+
extras_require = {
69+
'manual_install': ['ifcopenshell>=0.6', 'pythonocc-core==7.6.2'],
3770
},
38-
entry_points={
71+
entry_points = {
3972
'console_scripts': [
4073
'bim2sim = bim2sim:main',
4174
],

0 commit comments

Comments
 (0)