Skip to content

Commit

Permalink
update setup.py and add installation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DaJansenGit committed Dec 7, 2022
1 parent e77a8b9 commit 9a15809
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 37 deletions.
1 change: 1 addition & 0 deletions docs/source/docker-structure.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(docker_structure)=
# Docker image structure
As we implemented different plugins for each simulation we provide different
docker images for. To simplify development we split images into `env.`
Expand Down
30 changes: 25 additions & 5 deletions docs/source/first-steps.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
(First_steps)=

# First steps

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

## Console

Start your favorite console and type

```
$ python bim2sim -h
```

to see all available commands.

Now it's time to create your first project with bim2sim.

```
$ python bim2sim project create path/to/project -s teaser
```
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).
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.

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).
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.

If all is set up correctly, run

```
$ python bim2sim load path/to/project
```
to load and run an existing project. Then follow the instructions from your console.
When you are done, you can inspect the results from the `/results` folder of your project.

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

## Script

To include bim2sim in your scripts start with something like this:

```python
from bim2sim import Project
from bim2sim.log import default_logging_setup
Expand All @@ -44,7 +56,9 @@ else:
# else create a new one
project = Project.create(project_path, ifc_path, 'teaser')
```

now you have multiple options to run the project and handle it's decisions:

```python
# Option 1: handle decisions manually
for bunch in project.run():
Expand All @@ -58,4 +72,10 @@ run_project(project, ConsoleDecisionHandler())

# Option 3: write your own DecisionHandler and use it as in Option 2
```
Details about [DecisionHandlers](DecisionHandler).

Details about [DecisionHandlers](DecisionHandler).

## Examples

Please have also a look at `bim2sim/examples` which provide you some runnable
examples for PluginTEASER, PluginEnergyPlus and PluginLCA.
56 changes: 49 additions & 7 deletions docs/source/installation.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,58 @@
# Installation

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

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

if all worked well you should be able to start using bim2sim. Try
```
# create fresh python environment with conda
conda create -n bim2sim python=3.9
# activate your environment
conda activate bim2sim
# clone bim2sim repository (you can also use SSH if you prefer)
git clone https://github.com/BIM2SIM/bim2sim.git
cd bim2sim
# go into main directory of the repo where setup.py is stored and run
python setup.py install
# afterwards install the packages which are installable via pip
conda install -c conda-forge pythonocc-core=7.6.2 -y
conda install -c conda-forge ifcopenshell -y
```

If all worked well you should be able to start using bim2sim. Try

`python bim2sim -h`

to see all available commands. For further reading see [](First_steps).
We will improve this process by our own anaconda image soon.

## Plugins

To use the Plugins you have to install the requirements of the corresponding
plugins. Therefore just go the Plugin folder you want to use under
`bim2sim/plugins/` and run

```
pip install -r requirements.txt
```

to see all available commands. For further reading see
[First Steps](First_steps).


## Docker
tbd

We already create docker images for each the base `bim2sim` tool as for every
Plugin, but currently these are only available through our own registry. You can
still build the images yourself based on the existing Dockerfiles. As our
current structure is a bit complicated, please have a look at the explanation of
the [Docker Structure](docker_structure).

We will release the images on DockerHub soon to make them accessible for
everyone (see [issuue 452](https://github.com/BIM2SIM/bim2sim/issues/452)).
83 changes: 58 additions & 25 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,74 @@
from setuptools import setup, find_packages
import glob


data_files = []
directories = glob.glob('bim2sim\\assets\\')
for directory in directories:
files = glob.glob(directory + '*')
data_files.append((directory, files))

with open("README.md", 'r') as f:
long_description = f.read()
with open("requirements.txt", 'r') as f:
required = f.read().splitlines()
VERSION = "0.1.0"


setup(
name='bim2sim',
version='0.1.dev0',
version=VERSION,
description='Create simulation models from IFC files',
license="???",
license="LICENSE",
long_description=long_description,
long_description_content_type='text/markdown',
author='BIM2SIM',
author_email='???',
url="???",
packages=find_packages() + ['bim2sim.assets', 'bim2sim.backends'],
author_email='[email protected]',
url="https://github.com/BIM2SIM/bim2sim",
packages=find_packages(include=['bim2sim*']),
include_package_data=True,
data_files=data_files,
# package_data={'': ['assets/*.*']},
python_requires='>=3.6.0',
install_requires=[
'docopt', 'numpy', 'python-dateutil',
'mako', 'networkx>=2.2', 'pint'
], # external packages as dependencies
extras_require={
'manual_install': ['ifcopenshell>=0.6'],
'plotting': ['matplotlib'],
'communication': ['rpyc'],
data_files = [('bim2sim\\assets\\enrichment\\hvac', ['bim2sim\\assets\\enrichment\\hvac\\TypeBuildingElements.json']),
('bim2sim\\assets\\enrichment\\material', ['bim2sim\\assets\\enrichment\\material\\MaterialTemplates.json',
'bim2sim\\assets\\enrichment\\material\\TypeBuildingElements.json']),
('bim2sim\\assets\\enrichment\\usage', ['bim2sim\\assets\\enrichment\\usage\\commonUsages.json',
'bim2sim\\assets\\enrichment\\usage\\customUsages.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesAC20-FZK-Haus_with_SB55.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesAC20-Institute-Var-2_with_SB-1-0.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_fixed002.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_with_SB_neu.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesAC20-Institute-Var-2_with_SB-1-0.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_fixed002.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_with_SB_neu.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_with_SB88.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesFM_ARC_DigitalHub_with_SB89.json',
'bim2sim\\assets\\enrichment\\usage\\customUsagesKIT-EDC_with_SB.json',
'bim2sim\\assets\\enrichment\\usage\\UseConditions.json',
'bim2sim\\assets\\enrichment\\usage\\UseConditionsFM_ARC_DigitalHub_fixed002.json',
'bim2sim\\assets\\enrichment\\usage\\UseConditionsFM_ARC_DigitalHub_with_SB_neu.json',
'bim2sim\\assets\\enrichment\\usage\\UseConditionsFM_ARC_DigitalHub_with_SB89.json']),
('bim2sim\\assets\\finder', ['bim2sim\\assets\\finder\\template_ArchiCAD.json',
'bim2sim\\assets\\finder\\template_Autodesk Revit.json',
'bim2sim\\assets\\finder\\template_LuArtX_Carf.json',
'bim2sim\\assets\\finder\\template_TRICAD-MS.json']),


('bim2sim\\assets\\templates\\check_ifc', ['bim2sim\\assets\\templates\\check_ifc\\inst_template',
'bim2sim\\assets\\templates\\check_ifc\\prop_template',
'bim2sim\\assets\\templates\\check_ifc\\summary_template']),
('bim2sim\\assets\\templates\\modelica', ['bim2sim\\assets\\templates\\modelica\\tmplModel.txt']),
('bim2sim\\assets\\weatherfiles', ['bim2sim\\assets\\weatherfiles\\DEU_NW_Aachen.105010_TMYx.epw',
'bim2sim\\assets\\weatherfiles\\DEU_NW_Aachen.105010_TMYx.mos']),
('bim2sim\\assets\\ifc_example_files', ['bim2sim\\assets\\ifc_example_files\\AC20-FZK-Haus.ifc',
'bim2sim\\assets\\ifc_example_files\\ERC_EBC_mainbuilding.ifc',
'bim2sim\\assets\\ifc_example_files\\hvac_heating.ifc' ])

],

package_data={'': ['bim2sim/assets/*.*']},
python_requires='>=3.8.*,<3.10.*',
install_requires=[required
],

classifiers=[
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
extras_require = {
'manual_install': ['ifcopenshell>=0.6', 'pythonocc-core==7.6.2'],
},
entry_points={
entry_points = {
'console_scripts': [
'bim2sim = bim2sim:main',
],
Expand Down

0 comments on commit 9a15809

Please sign in to comment.