# SfePrapy

Structural fire engineering (Sfe) probabilistic reliability assessment (Pra) in python (py) - is a probabilistic analysis tool that estimates the structural reliability for given scenarios (such as enclosure geometry, building type, window areas etc.) against equivalent time exposure to the ISO 834 fire curve.

## Getting Started

Documentation can be found in the [wiki](https://github.com/fsepy/SfePrapy/wiki).

### Installation

[Python](https://www.python.org/downloads/) 3.7 or later is required. [Anaconda Distribution](https://www.anaconda.com/distribution/#download-section) is recommended for new starters, it includes Python and few useful packages.

pip is a package management system for installing and updating Python packages. pip comes with Python, so you get pip simply by installing Python. On Ubuntu and Fedora Linux, you can simply use your system package manager to install the `python3-pip` package. [The Hitchhiker's Guide to Python](https://docs.python-guide.org/starting/installation/) provides some guidance on how to install Python on your system if it isn't already; you can also install Python directly from [python.org](https://www.python.org/getit/). You might want to [upgrade pip](https://pip.pypa.io/en/stable/installing/) before using it to install other programs.

1. to use `pip` install from PyPI:

    ```sh
    pip install --upgrade sfeprapy
    ```

2. to use `pip` install from GitHub (requires [git](https://git-scm.com/downloads)):

    ```sh
    pip install --upgrade "git+https://github.com/fsepy/SfePrapy.git@master"
    ```

![demo_save_example_input_file](./misc/fig/demo_install_sfeprapy.gif)


### To produce an example input file

```python
>>> import sfeprapy.mcs0
>>> with open('example_input.csv', 'w') as f:
>>> 	f.write(sfeprapy.mcs0.EXAMPLE_INPUT_CSV)
```

![demo_save_example_input_file](./misc/fig/demo_save_example_input_file.gif)

### To produce an example configuration file

```python
>>> import json
>>> import sfeprapy.mcs0
>>> with open('config.json', 'w') as f:
>>> 	json.dump(sfeprapy.mcs0.EXAMPLE_CONFIG_DICT, f)
```

![demo_save_example_input_file](./misc/fig/demo_save_example_config_file.gif)

### To run `sfeprapy.mcs0` simulation

```shell
python -m sfeprapy.mcs0
```

![demo_running_sfeprapy.mcs0](misc/fig/demo_running_sfeprapy.mcs0.gif)

## Authors

**Ian Fu** - *fuyans@gmail.com*  
**Danny Hopkin** - *danny.hopkin@ofrconsultants.com*  
**Ieuan Rickard** - *ieuan.rickard@ofrconsultants.com*

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
