Repository: IN-CORE/pyincore (language: python)

Issue:
would always return a testing version



Discussion / hints:

Fix patch:
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 000000000..5ceb3864c
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,1 @@
+venv
diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml
new file mode 100644
index 000000000..a91cb0fff
--- /dev/null
+++ b/.github/workflows/pypi.yaml
@@ -0,0 +1,81 @@
+name: Publish Python package
+
+on:
+  release:
+    types:
+      - published
+
+  pull_request:
+
+jobs:
+  publish:
+    name: Build and publish python packages
+    runs-on: ubuntu-18.04
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: get release info
+        id: release_info
+        run: |
+          if [ "${{ github.event.release.tag_name }}" != "" ]; then
+            version=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//')
+          else
+            version="$(awk -F= '/^PACKAGE_VERSION/ { print $2}' pyincore/globals.py | sed 's/[ "]//g').${{ github.run_number }}"
+          fi
+          echo "VERSION=${version}" >> $GITHUB_ENV
+          echo "VERSION=${version}"
+          ./version.sh ${version}
+
+          testing=$(echo $version | sed 's/[0-9\.]//g')
+          if [ "$testing" == "" ]; then
+            echo "REPO_URL=" >> $GITHUB_ENV
+            echo "TOKEN=${{ secrets.PYPI_API_TOKEN }}" >> $GITHUB_ENV
+          else
+            echo "REPO_URL=https://test.pypi.org/legacy/" >> $GITHUB_ENV
+            echo "TOKEN=${{ secrets.TEST_PYPI_API_TOKEN }}" >> $GITHUB_ENV
+          fi
+
+      - name: Set up Python 3.8
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.8
+
+      - name: Install dependencies
+        run: python -m pip install --upgrade pip setuptools wheel
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r requirements.txt
+
+      - name: Cache pip
+        uses: actions/cache@v2
+        with:
+          # This path is specific to Ubuntu
+          path: ~/.cache/pip
+          # Look to see if there is a cache hit for the corresponding requirements file
+          key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
+          restore-keys: |
+            ${{ runner.os }}-pip-
+            ${{ runner.os }}-
+
+      - name: Build dist file
+        run: |
+          python setup.py sdist bdist_wheel
+
+      - name: Publish distribution to PyPI
+        if: github.event_name == 'release'
+        uses: pypa/gh-action-pypi-publish@master
+        with:
+          password: ${{ env.TOKEN }}
+          repository_url: ${{ env.REPO_URL }}
+
+      - name: Upload binaries to release
+        if: github.event_name == 'release'
+        uses: svenstaro/upload-release-action@v2
+        with:
+          repo_token: ${{ secrets.GITHUB_TOKEN }}
+          file: dist/pyincore-${{ env.VERSION }}*
+          file_glob: true
+          overwrite: true
diff --git a/.github/workflows/requirements.yaml b/.github/workflows/requirements.yaml
new file mode 100644
index 000000000..9ddd75e9c
--- /dev/null
+++ b/.github/workflows/requirements.yaml
@@ -0,0 +1,37 @@
+name: requirements
+
+# This will check to see if there are new requirements and will
+# automatically create a pull request.
+on:
+  push:
+    branches:
+      - main
+
+  schedule:
+    - cron: '0 0 * * *'
+
+# Certain actions will only run when this is the main repo.
+env:
+  MAIN_REPO: IN-CORE/pyincore
+
+jobs:
+  pyclowder:
+    runs-on: ubuntu-latest
+    if: github.repository == env.MAIN_REPO
+
+    steps:
+      - uses: actions/checkout@v3
+
+      # check all requirements
+      - name: requirements check
+        run: |
+          ./requirements.sh
+
+      # try and create a PR
+      - name: create PR if needed
+        uses: peter-evans/create-pull-request@v3
+        with:
+          commit-message: "Updated requirements"
+          title: "Updated requirements"
+          reviewers: IN-CORE/core-dev
+          delete-branch: true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 48df66dcf..c4528a2ee 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,12 +5,18 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/)
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
-## [Unreleased]
+## [1.5.0] - 2022-06-29
+
+### Added
+- PyPi description and README.rst [#150](https://github.com/IN-CORE/pyincore/issues/150)
+- Earthquake liquefaction to building damage analysis [#155](https://github.com/IN-CORE/pyincore/issues/155)
+- When releases are made, now push builds to pypi (or testpypi) automatically
 
 ### Changed
 - Made pyincore build with legacy naming for pypi publish [#138](https://github.com/IN-CORE/pyincore/issues/138)
 - Network dataset's sub category's dataType has been changed from networkType to dataType [#145](https://github.com/IN-CORE/pyincore/issues/145)
 - Tornado EPN damage analysis uses network dataset instead of link, node, graph datasets [#147](https://github.com/IN-CORE/pyincore/issues/147)
+- Building functionality to compute functionality without power network [#143](https://github.com/IN-CORE/pyincore/issues/143)
 
 ## [1.4.1] - 2022-04-22
 
diff --git a/Dockerfile b/Dockerfile
index 5900cb9b8..9445a2668 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -7,11 +7,11 @@ USER root
 
 # install packages
 WORKDIR /src
-COPY requirements.txt .
+COPY environment.yml .
 ENV PATH "$MAMBA_ROOT_PREFIX/bin:$PATH"
 RUN micromamba install -y -n base -c conda-forge \
     sphinx sphinx_rtd_theme \
-    -f requirements.txt
+    -f environment.yml
 
 # copy code and generate documentation
 COPY . ./
diff --git a/docs/source/conf.py b/docs/source/conf.py
index e044e652a..9754dce21 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -33,9 +33,9 @@
 author = ''
 
 # The short X.Y version
-version = '1.4'
+version = '1.5'
 # The full version, including alpha/beta/rc tags
-release = '1.4.1'
+release = '1.5.0'
 
 # -- General configuration ---------------------------------------------------
 
diff --git a/environment.yml b/environment.yml
index 1e69a59b7..e53586716 100644
--- a/environment.yml
+++ b/environment.yml
@@ -1,26 +1,21 @@
-name: base
+name: pyincore
 channels:
   - conda-forge
   - defaults
 dependencies:
-  - boto3
-  - deprecated
+  - ipopt>=3.11
   - fiona>=1.8.4
   - geopandas>=0.6.1
-  - ipopt>=3.11
-  - jsonpickle>=1.1
+  - matplotlib>=2.1.0
   - networkx>=2.2
   - numpy>=1.16.6,<2.0a0
-  - owslib>=0.17.1
   - pandas>=0.24.1
   - pycodestyle>=2.6.0
   - pyomo>=5.6
   - pyproj>=1.9.6
   - pytest>=3.9.0
   - python-jose>=3.0
-  - pyyaml>=3.13
   - rasterio>=1.0.18
-  - requests>=2.21.0
   - rtree>=0.8.3
   - scipy>=1.2.0
   - shapely>=1.6.4.post1
diff --git a/pyincore/analyses/transportationrecovery/complete_transportation_recovery.ipynb b/pyincore/analyses/transportationrecovery/complete_transportation_recovery.ipynb
deleted file mode 100644
index d5021e132..000000000
--- a/pyincore/analyses/transportationrecovery/complete_transportation_recovery.ipynb
+++ /dev/null
@@ -1,304 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Shelby County Transportation Recovery Model"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "import json\n",
-    "import pandas as pd\n",
-    "from pyincore import IncoreClient, InventoryDataset, Dataset, DataService\n",
-    "from pyincore.analyses.bridgedamage import BridgeDamage\n",
-    "from pyincore.analyses.transportationrecovery import TransportationRecovery\n",
-    "from pyincore.analyses.transportationrecovery import TransportationRecoveryUtil"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## RUN Bridge damage analysis"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### Set up input datasets and parameters"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "client = IncoreClient()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "hazard_type = \"earthquake\"\n",
-    "hazard_id = \"5b902cb273c3371e1236b36b\"\n",
-    "\n",
-    "# NBSR bridges\n",
-    "bridge_dataset_id = \"5a284f2dc7d30d13bc082040\"\n",
-    "\n",
-    "# Default Bridge Fragility Mapping on incore-service\n",
-    "mapping_id = \"5b47bcce337d4a37755e0cb2\"\n",
-    "\n",
-    "# Use hazard uncertainty for computing damage\n",
-    "use_hazard_uncertainty = False\n",
-    "\n",
-    "# Use liquefaction (LIQ) column of bridges to modify fragility curve\n",
-    "use_liquefaction = False"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "# Create bridge damage \n",
-    "bridge_dmg = BridgeDamage(client)\n",
-    "\n",
-    "# Load input datasets\n",
-    "bridge_dmg.load_remote_input_dataset(\"bridges\", bridge_dataset_id)\n",
-    "\n",
-    "# Specify the result name\n",
-    "result_name = \"bridge_result\"\n",
-    "\n",
-    "# Set analysis parameters\n",
-    "bridge_dmg.set_parameter(\"result_name\", result_name)\n",
-    "bridge_dmg.set_parameter(\"mapping_id\", mapping_id)\n",
-    "bridge_dmg.set_parameter(\"hazard_type\", hazard_type)\n",
-    "bridge_dmg.set_parameter(\"hazard_id\", hazard_id)\n",
-    "bridge_dmg.set_parameter(\"num_cpu\", 4)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "bridge_dmg.run_analysis()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "bridge_dmg.get_output_datasets()"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### damamge result ouptut"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "bridge_damage = pd.read_csv('bridge_result.csv')\n",
-    "bridge_damage.head()"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## lookup average daily traffic from National Bridge Inventory"
-   ]
-  },
-  {
-   "cell_type": "raw",
-   "metadata": {},
-   "source": [
-    "# download the ADT information from National Bridge Inventory: \n",
-    "# https://www.fhwa.dot.gov/bridge/nbi/ascii.cfm\n",
-    "\n",
-    "# convert the unit of lat and long from degree to decimal\n",
-    "TN17 = TransportationRecoveryUtil.NBI_coordinate_mapping('Data/TN17.csv')\n",
-    "TN17.to_csv('TN17.csv')\n",
-    "\n",
-    "# use GIS tool to convert TN17 into a shapefile"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "bridges_set = InventoryDataset('cache_data/nbsrbridges/nbsrbridges.shp')\n",
-    "bridges = list(bridges_set.inventory_set)\n",
-    "\n",
-    "datasvc = DataService(client)\n",
-    "datasvc.get_dataset_blob(\"5c5de6c1c5c0e488fc04291b\")\n",
-    "TN17 = 'cache_data/TN17/TN17.shp'\n",
-    "ADT = TransportationRecoveryUtil.get_average_daily_traffic(bridges, TN17)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "with open('cache_data/ADT.json', 'w') as f:\n",
-    "    json.dump(ADT, f)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### convert bridge damage output to the format that transportation recovery model accepts"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "bridge_damage_value, unrepaired_bridge = TransportationRecoveryUtil.convert_dmg_prob2state(\"bridge_result.csv\")"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "with open('cache_data/bridge_damage_value.json', 'w') as f:\n",
-    "    json.dump(bridge_damage_value, f)\n",
-    "with open('cache_data/unrepaired_bridge.json', 'w') as f:\n",
-    "    json.dump(unrepaired_bridge, f)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Calculate Transportation Recovery"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "transportation_recovery = TransportationRecovery(client)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "nodes = \"5c5de1dec5c0e488fc0355f7\"\n",
-    "transportation_recovery.load_remote_input_dataset(\"nodes\", nodes)\n",
-    "\n",
-    "links = \"5c5de25ec5c0e488fc035613\"\n",
-    "transportation_recovery.load_remote_input_dataset(\"links\", links)\n",
-    "\n",
-    "bridges = \"5a284f2dc7d30d13bc082040\"\n",
-    "transportation_recovery.load_remote_input_dataset('bridges', bridges)\n",
-    "\n",
-    "bridge_damage = \"5c5ddff0c5c0e488fc0355df\"\n",
-    "transportation_recovery.load_remote_input_dataset('bridge_damage_value', bridge_damage)\n",
-    "\n",
-    "unrepaired = \"5c5de0c5c5c0e488fc0355eb\"\n",
-    "transportation_recovery.load_remote_input_dataset('unrepaired_bridge', unrepaired)\n",
-    "\n",
-    "ADT_data = \"5c5dde00c5c0e488fc032d7f\"\n",
-    "transportation_recovery.load_remote_input_dataset('ADT', ADT_data)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "transportation_recovery.set_parameter(\"num_cpu\", 4)\n",
-    "transportation_recovery.set_parameter(\"pm\", 1)\n",
-    "transportation_recovery.set_parameter('ini_num_population', 5)\n",
-    "transportation_recovery.set_parameter(\"population_size\", 3)\n",
-    "transportation_recovery.set_parameter(\"num_generation\", 2)\n",
-    "transportation_recovery.set_parameter(\"mutation_rate\", 0.1)\n",
-    "transportation_recovery.set_parameter(\"crossover_rate\", 1.0)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "transportation_recovery.run_analysis()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "transportation_recovery.get_output_datasets()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 3",
-   "language": "python",
-   "name": "python3"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 3
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython3",
-   "version": "3.6.9"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/pyincore/analyses/transportationrecovery/transportation_recovery.ipynb b/pyincore/analyses/transportationrecovery/transportation_recovery.ipynb
deleted file mode 100644
index f72b68f14..000000000
--- a/pyincore/analyses/transportationrecovery/transportation_recovery.ipynb
+++ /dev/null
@@ -1,126 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Shelby County Transportation Recovery Model"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "import json\n",
-    "import pandas as pd\n",
-    "from pyincore import IncoreClient, InventoryDataset, Dataset\n",
-    "from pyincore.analyses.transportationrecovery import TransportationRecovery"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Calculate Transportation Recovery"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "client = IncoreClient()\n",
-    "transportation_recovery = TransportationRecovery(client)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "nodes = \"5c5de1dec5c0e488fc0355f7\"\n",
-    "transportation_recovery.load_remote_input_dataset(\"nodes\", nodes)\n",
-    "\n",
-    "links = \"5c5de25ec5c0e488fc035613\"\n",
-    "transportation_recovery.load_remote_input_dataset(\"links\", links)\n",
-    "\n",
-    "bridges = \"5a284f2dc7d30d13bc082040\"\n",
-    "transportation_recovery.load_remote_input_dataset('bridges', bridges)\n",
-    "\n",
-    "bridge_damage = \"5c5ddff0c5c0e488fc0355df\"\n",
-    "transportation_recovery.load_remote_input_dataset('bridge_damage_value', bridge_damage)\n",
-    "\n",
-    "unrepaired = \"5c5de0c5c5c0e488fc0355eb\"\n",
-    "transportation_recovery.load_remote_input_dataset('unrepaired_bridge', unrepaired)\n",
-    "\n",
-    "ADT_data = \"5c5dde00c5c0e488fc032d7f\"\n",
-    "transportation_recovery.load_remote_input_dataset('ADT', ADT_data)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "transportation_recovery.set_parameter(\"num_cpu\", 4)\n",
-    "transportation_recovery.set_parameter(\"pm\", 1)\n",
-    "transportation_recovery.set_parameter('ini_num_population', 5)\n",
-    "transportation_recovery.set_parameter(\"population_size\", 3)\n",
-    "transportation_recovery.set_parameter(\"num_generation\", 2)\n",
-    "transportation_recovery.set_parameter(\"mutation_rate\", 0.1)\n",
-    "transportation_recovery.set_parameter(\"crossover_rate\", 1.0)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "transportation_recovery.run_analysis()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "transportation_recovery.get_output_datasets()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 3",
-   "language": "python",
-   "name": "python3"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 3
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython3",
-   "version": "3.6.4"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/pyincore/globals.py b/pyincore/globals.py
index 30d193583..f2a7c56bd 100644
--- a/pyincore/globals.py
+++ b/pyincore/globals.py
@@ -10,7 +10,7 @@
 import os
 import shutil
 
-PACKAGE_VERSION = "1.4.1"
+PACKAGE_VERSION = "1.5.0"
 
 INCORE_API_PROD_URL = "https://incore.ncsa.illinois.edu"
 INCORE_API_DEV_URL = "https://incore-dev.ncsa.illinois.edu"
diff --git a/recipes/meta.yaml b/recipes/meta.yaml
index db6e8e2c4..79c2325ab 100644
--- a/recipes/meta.yaml
+++ b/recipes/meta.yaml
@@ -1,14 +1,24 @@
 {% set name = "pyincore" %}
-{% set version = "1.4.1" %}
+{% set version = "1.5.0" %}
  
 package:
   name: {{ name|lower }}
   version: {{ version }}
- 
+
 source:
   path: /path/to/pyincore
-  # PR: https://opensource.ncsa.illinois.edu/bitbucket/projects/INCORE1/repos/pyincore/pull-requests/12/overview
- 
+
+about:
+  home: https://incore.ncsa.illinois.edu
+  license: MPL-2.0
+  summary: 'Python library for IN-CORE (Interdependent Networked Community Resilience Modeling Environment)'
+  description: 'pyIncore is a component of IN-CORE. It is a python package consisting of two primary components: 
+  1) a set of service classes to interact with the IN-CORE web services, and 2) IN-CORE analyses. The pyIncore 
+  package allows users to apply various hazards to infrastructure in selected areas, propagating the effect of 
+  physical infrastructure damage and loss of functionality to social and economic impacts.'
+  dev_url: https://github.com/IN-CORE/pyincore
+  doc_url: https://incore.ncsa.illinois.edu/doc/incore
+
 build:
   # If this is a new build for the same version, increment the build
   # number. If you do not include this key, it defaults to 0.
@@ -20,62 +30,43 @@ requirements:
   build:
     - python>=3.8
     - pip
-    - numpy 1.16
+    - numpy>=1.16.6,<2.0a0
  
   host:
     - python>=3.6
     - pip
-    - numpy 1.16
-     
+    - numpy>=1.16.6,<2.0a0
+
   run:
     - python>=3.6
+    - ipopt>=3.11
     - {{ pin_compatible('numpy') }}
-    - boto3
-    - deprecated
     - fiona>=1.8.4
     - geopandas>=0.6.1
-    - jsonpickle>=1.1
-    - libspatialindex>=1.9.0
+    - matplotlib>=2.1.0
     - networkx>=2.2
-    - numpy>=1.16.1
-    - pytest>=3.9.0
-    - python-jose>=3.0
-    - pyproj>=1.9.6
-    - pyyaml>=3.13
-    - pycodestyle>=2.6.0
-    - pyomo>=5.6
-    - owslib>=0.17.1
     - pandas>=0.24.1
+    - pyomo>=5.6
+    - pyproj>=1.9.6
     - rasterio>=1.0.18
-    - requests>=2.21.0
+    - requests=2.28.0
     - rtree>=0.8.3
     - scipy>=1.2.0
     - shapely>=1.6.4.post1
     - wntr>=0.1.6
-    - ipopt>=3.11
- 
+
 test:
   # Python imports
   imports:
     - pyincore
-    - pyomo
    
   requires:
     # Put any additional test requirements here.  For example
-    - pytest>=3.9
+    - pytest>=3.9.0
+    - pycodestyle>=2.6.0
+    - python-jose>=3.0
+
   commands:
     # You can put built-in test commands to be run here.  Use this to test that the entry points work.
     python -c "import pyincore; print('SUCCESS')" #; pyincore.test_client()"
     # You can also put a file called run_test.py in the recipe that will be run at test time.
- 
-about:
-  home: https://incore.ncsa.illinois.edu
-  license: MPL-2.0
-  summary: 'Python library for IN-CORE (Interdependent Networked Community Resilience Modeling Environment)'
-  description: 'pyIncore is a component of IN-CORE. It is a python package consisting of two primary components: 
-  1) a set of service classes to interact with the IN-CORE web services, and 2) IN-CORE analyses. The pyIncore 
-  package allows users to apply various hazards to infrastructure in selected areas, propagating the effect of 
-  physical infrastructure damage and loss of functionality to social and economic impacts.'
-  dev_url: https://github.com/IN-CORE/pyincore
-  doc_url: https://incore.ncsa.illinois.edu/doc/incore
-
diff --git a/requirements.imports b/requirements.imports
new file mode 100644
index 000000000..9ce19abe4
--- /dev/null
+++ b/requirements.imports
@@ -0,0 +1,17 @@
+
+fiona
+geopandas
+matplotlib
+networkx
+numpy
+pandas
+pyomo
+pyproj
+rasterio
+rtree
+scipy
+shapely
+wntr
+pycodestyle
+pytest
+python-jose
diff --git a/requirements.min b/requirements.min
new file mode 100644
index 000000000..b05f11e68
--- /dev/null
+++ b/requirements.min
@@ -0,0 +1,17 @@
+fiona>=1.8.4
+geopandas>=0.6.1
+ipopt>=3.11
+matplotlib>=2.1.0
+networkx>=2.2
+numpy>=1.16.6,<2.0a0
+pandas>=0.24.1
+pycodestyle>=2.6.0
+pyomo>=5.6
+pyproj>=1.9.6
+pytest>=3.9.0
+python-jose>=3.0
+rasterio>=1.0.18
+rtree>=0.8.3
+scipy>=1.2.0
+shapely>=1.6.4.post1
+wntr>=0.1.6
diff --git a/requirements.sh b/requirements.sh
new file mode 100755
index 000000000..01da4556a
--- /dev/null
+++ b/requirements.sh
@@ -0,0 +1,158 @@
+#!/bin/bash
+
+set -o noglob
+
+#TESTPYPI="--extra-index-url https://test.pypi.org/simple/ --pre"
+
+MODULE="pyincore"
+CONDA_IMPORTS="ipopt>=3.11"
+
+# setup pip-compile to resolve dependencies, also is minimal version of python
+if [ ! -d /tmp/pyincore-requirements ]; then
+  python3 -m virtualenv /tmp/pyincore-requirements
+  . /tmp/pyincore-requirements/bin/activate
+  pip install pip-tools
+else
+  . /tmp/pyincore-requirements/bin/activate
+fi
+
+# all requirements in pyincore_viz files
+rm -f requirements.imports
+for x in ${MODULE} tests notebooks; do
+  case $x in
+    notebooks)
+      FILES="*.ipynb"
+      FOLDER="${MODULE}"
+      ;;
+    *)
+      FILES="*.py"
+      FOLDER="${x}"
+      ;;
+  esac
+  IMPORTS=$(egrep -R -h --include "${FILES}" '(import|from) ' ${FOLDER} | \
+            sed -e 's/^ *"//' -e 's/\\n",$//' | \
+            egrep '^(from|import)' | \
+            awk "!/${MODULE}/ { print \$2 }" | \
+            sort -u | \
+            egrep -v '^(\(|_)' | \
+            sed 's/,/ /g')
+  if [ "${IMPORTS}" == "" ]; then continue; fi
+  # check which imports are not standard python
+  rm -f requirements.tmp
+  for i in $IMPORTS; do
+    MISSING=$(python3 -c "import $i" 2>&1 | \
+      awk '/ModuleNotFoundError/ { print $5 }' | \
+      sed -e 's/yaml/pyyaml/' -e 's/jose/python-jose/' -e 's/_pytest/pytest/' -e 's/PIL/pillow/' -e 's/osgeo/gdal/' -e "s/'//g")
+    if [ "$MISSING" == "gdal" ]; then
+      echo "'$MISSING' needs to be installed"
+    elif ! grep "${MISSING}" requirements.imports &>/dev/null ; then
+      echo ${MISSING} >> requirements.tmp
+    fi
+  done
+  sort -u requirements.tmp > requirements.${x}
+  cat requirements.${x} >> requirements.imports
+done
+
+# find latest version of all packages needed to install
+rm -f requirements.in
+for p in $(cat requirements.imports ); do
+  PACKAGE="$p"
+  VERSION=$(grep "^${PACKAGE}" 2>/dev/null requirements.min | sed "s/^${PACKAGE}//")
+  echo "$p$VERSION" >> requirements.in
+done
+pip-compile ${TESTPYPI} --quiet --upgrade --rebuild --output-file requirements.tmp requirements.in
+cat requirements.tmp | grep -v ' *#.*' | grep -v '^$' | grep -v "^--" > requirements.ver
+
+# create a markdown file with what we found.
+cat << EOF > versions.md
+# ${MODULE} dependencies version list
+
+This file is autogenerated and lists the latest versions of all dependencies. The table will list package (pip and conda), minimum version and latest version found.
+
+| PIP Package | Conda Package | Required Version | Matched Version (pip) |
+|-------------|---------------|------------------|-----------------------|
+EOF
+
+# create the environment.yml file for conda. This is intended to setup a conda environment for
+# development on pyincore_viz.
+cat << EOF > environment.yml
+name: ${MODULE}
+channels:
+  - conda-forge
+  - defaults
+dependencies:
+EOF
+for r in ${CONDA_IMPORTS}; do
+  echo "  - $r" >> environment.yml
+done
+
+# create the requirements.txt file for pip
+cat << EOF > requirements.txt
+# This file is autogenerated
+EOF
+
+# all dependencies found
+for p in $(cat requirements.imports | sort -u ); do
+  if [ "$p" == "" ]; then continue; fi
+  PACKAGE="$p"
+  LATEST=$(grep "^${PACKAGE}" 2>/dev/null requirements.ver | sed "s/^${PACKAGE}//")
+  VERSION=$(grep "^${PACKAGE}" 2>/dev/null requirements.min | sed -e "s/^${PACKAGE}//")
+  MD_VERSION=$(echo $VERSION | sed -e 's/\([<>]\)/\\\1/g')
+  if [ "${VERSION}" == "" ]; then
+    echo "NO VERSION SPECIFIED FOR $p"
+  fi
+  LATEST=$(grep "^${PACKAGE}==" 2>/dev/null requirements.ver | sed "s/^${PACKAGE}==//")
+  CONDA=$(echo ${PACKAGE} | sed -e 's/fastjsonschema/python-fastjsonschema/' \
+                        -e 's/ipython-genutils/ipython_genutils/' \
+                        -e 's/jupyter-core/jupyter_core/' \
+                        -e 's/jupyter-client/jupyter_client/' \
+                        -e 's/jupyterlab-pygments/jupyterlab_pygments/' \
+                        -e 's/jupyterlab-widgets/jupyterlab_widgets/' \
+                        -e 's/prometheus-client/prometheus_client/' \
+                        -e 's/stack-data/stack_data/')
+  echo -n "| ${PACKAGE} " >> versions.md
+  if [ "${CONDA}" == "${PACKAGE}" ]; then
+    echo -n "| " >> versions.md
+  else
+    echo -n "| ${CONDA} " >> versions.md
+  fi
+  echo -n "| ${MD_VERSION}" >> versions.md
+  echo -n "| ${LATEST} " >> versions.md
+  echo "|" >> versions.md
+
+  echo "  - ${p}${VERSION}" >> environment.yml
+  echo "${p}${VERSION}" >> requirements.txt
+  sed -i~ "s/    - ${p}.*/    - ${p}${VERSION}/" recipes/meta.yaml
+  sed -i~ "s/^\(  *\)'$p.*'/\1'${p}${VERSION}'/" setup.py
+done
+
+# document all other dependencies
+for r in $(cat requirements.ver); do
+  PACKAGE=${r%%=*}
+  if grep "$PACKAGE" requirements.imports 2>&1 >/dev/null; then continue; fi
+  VERSION=$(grep "^${PACKAGE}" 2>/dev/null requirements.min | sed "s/^${PACKAGE}//")
+  CONDA=$(echo ${PACKAGE} | sed -e 's/fastjsonschema/python-fastjsonschema/' \
+                        -e 's/ipython-genutils/ipython_genutils/' \
+                        -e 's/jupyter-core/jupyter_core/' \
+                        -e 's/jupyter-client/jupyter_client/' \
+                        -e 's/jupyterlab-pygments/jupyterlab_pygments/' \
+                        -e 's/jupyterlab-widgets/jupyterlab_widgets/' \
+                        -e 's/prometheus-client/prometheus_client/' \
+                        -e 's/stack-data/stack_data/')
+  echo -n "| ${PACKAGE} " >> versions.md
+  if [ "${CONDA}" == "${PACKAGE}" ]; then
+    echo -n "| " >> versions.md
+  else
+    echo -n "| ${CONDA} " >> versions.md
+  fi
+  if [ "$VERSION" != "" ]; then
+    echo -n "| ~~${VERSION}~~" >> versions.md
+  else
+    echo -n "| " >> versions.md
+  fi
+  echo -n "| ${r##*==} " >> versions.md
+  echo "|" >> versions.md
+done
+
+## cleanup
+rm -f requirements.${MODULE} requirements.tests requirements.notebooks requirements.tmp requirements.ver  requirements.in
diff --git a/requirements.txt b/requirements.txt
index 4dc4e776d..20004b6bf 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,21 +1,16 @@
-boto3
-deprecated
+# This file is autogenerated
 fiona>=1.8.4
 geopandas>=0.6.1
-ipopt>=3.11
-jsonpickle>=1.1
+matplotlib>=2.1.0
 networkx>=2.2
 numpy>=1.16.6,<2.0a0
-owslib>=0.17.1
 pandas>=0.24.1
 pycodestyle>=2.6.0
 pyomo>=5.6
 pyproj>=1.9.6
 pytest>=3.9.0
 python-jose>=3.0
-pyyaml>=3.13
 rasterio>=1.0.18
-requests>=2.21.0
 rtree>=0.8.3
 scipy>=1.2.0
 shapely>=1.6.4.post1
diff --git a/scripts/release-packages.yml b/scripts/release-packages.yml
index d555477f0..131218e09 100644
--- a/scripts/release-packages.yml
+++ b/scripts/release-packages.yml
@@ -1,7 +1,7 @@
 # List of pyincore analyses to either include or exclude for release
 # If provided, 'excludes' takes preference over 'includeOnly'
 
-version: '1.4.1'
+version: '1.5.0'
 
 includeOnly:
   - buildingdamage
diff --git a/setup.py b/setup.py
index 8c89e5d7f..e5119b1b0 100644
--- a/setup.py
+++ b/setup.py
@@ -5,34 +5,24 @@
 # and is available at https://www.mozilla.org/en-US/MPL/2.0/
 
 from setuptools import setup, find_packages
-import pkg_resources
-from pyincore import globals as pyglobals
-import pypandoc
 
-pkg_resources.extern.packaging.version.Version = pkg_resources.SetuptoolsLegacyVersion
-
-# use the version from the rasterio module.
-version = pyglobals.PACKAGE_VERSION
-# use this line for manual versioning like rc version
-#version = '1.4.1.rc.4'
+# version number of pyincore
+version = '1.5.0'
 
 with open("README.rst", encoding="utf-8") as f:
     readme = f.read()
 
-setup_args = dict(
+setup(
     name='pyincore',
     version=version,
-    packages=find_packages(where=".", exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
-    include_package_data=True,
-    package_data={
-        '': ['*.ini']
-    },
     description='IN-CORE analysis tool python package',
     long_description=readme,
-    # TODO need to figure out what are the dependency requirements
-    # TODO this is a hack, really should only be packages needed to run
-    install_requires=[line.strip() for line in open("requirements.txt").readlines()],
-    python_requires=">=3.6, <3.9",
+    long_description_content_type='text/x-rst',
+
+    url='https://incore.ncsa.illinois.edu',
+
+    license="Mozilla Public License v2.0",
+
     classifiers=[
         "Development Status :: 4 - Beta",
         "Intended Audience :: Science/Research",
@@ -42,6 +32,7 @@
         "Programming Language :: Python :: 3",
         "Topic :: Scientific/Engineering"
     ],
+
     keywords=[
         "infrastructure",
         "resilience",
@@ -54,8 +45,41 @@
         "hurricane",
         "dislocation"
     ],
-    license="Mozilla Public License v2.0",
-    url="https://opensource.ncsa.illinois.edu/bitbucket/projects/INCORE1/repos/pyincore/"
-)
 
-setup(**setup_args)
\ No newline at end of file
+    packages=find_packages(where=".", exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
+    include_package_data=True,
+    package_data={
+        '': ['*.ini']
+    },
+
+    python_requires=">=3.6",
+
+    install_requires=[
+        'fiona>=1.8.4',
+        'geopandas>=0.6.1',
+        'matplotlib>=2.1.0',
+        'networkx>=2.2',
+        'numpy>=1.16.6,<2.0a0',
+        'pandas>=0.24.1',
+        'pyomo>=5.6',
+        'pyproj>=1.9.6',
+        'rasterio>=1.0.18',
+        'rtree>=0.8.3',
+        'scipy>=1.2.0',
+        'shapely>=1.6.4.post1',
+        'wntr>=0.1.6',
+    ],
+
+    extras_require={
+        'test': [
+            'pycodestyle>=2.6.0',
+            'pytest>=3.9.0',
+            'python-jose>=3.0',
+        ]
+    },
+
+    project_urls={
+        'Bug Reports': 'https://github.com/IN-CORE/pyincore/issues',
+        'Source': 'https://github.com/IN-CORE/pyincore',
+    },
+)
diff --git a/version.sh b/version.sh
new file mode 100755
index 000000000..59909bce6
--- /dev/null
+++ b/version.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+VERSION=${1:-9.9.9rc99}
+MAJOR=${VERSION%.*}
+
+if [ -e CHANGELOG.md ]; then
+  sed -i~ "s/## unreleased.*/## ${VERSION} - $(date +'%Y-%m-%d')/i" CHANGELOG.md
+fi
+
+sed -i~ "s/PACKAGE_VERSION = \".*\"/PACKAGE_VERSION = \"${VERSION}\"/" pyincore/globals.py
+
+sed -i~ "s/version = \".*\"/version = \"${VERSION}\"/" recipes/meta.yaml
+sed -i~ "s/version: '.*'/version: '${VERSION}'/" scripts/release-packages.yml
+
+sed -i~ -e "s/release = '.*'/release = '${VERSION}'/" -e "s/version = '.*'/version = '${MAJOR}'/" docs/source/conf.py
+
+sed -i~ "s/version = .*/version = '${VERSION}'/" setup.py
diff --git a/versions.md b/versions.md
new file mode 100644
index 000000000..8ea78ddcf
--- /dev/null
+++ b/versions.md
@@ -0,0 +1,46 @@
+# pyincore dependencies version list
+
+This file is autogenerated and lists the latest versions of all dependencies. The table will list package (pip and conda), minimum version and latest version found.
+
+| PIP Package | Conda Package | Required Version | Matched Version (pip) |
+|-------------|---------------|------------------|-----------------------|
+| fiona | | \>=1.8.4| 1.8.21 |
+| geopandas | | \>=0.6.1| 0.11.0 |
+| matplotlib | | \>=2.1.0| 3.5.2 |
+| networkx | | \>=2.2| 2.8.4 |
+| numpy | | \>=1.16.6,\<2.0a0| 1.23.0 |
+| pandas | | \>=0.24.1| 1.4.3 |
+| pycodestyle | | \>=2.6.0| 2.8.0 |
+| pyomo | | \>=5.6| 6.4.1 |
+| pyproj | | \>=1.9.6| 3.3.1 |
+| pytest | | \>=3.9.0| 7.1.2 |
+| python-jose | | \>=3.0| 3.3.0 |
+| rasterio | | \>=1.0.18| 1.2.10 |
+| rtree | | \>=0.8.3| 1.0.0 |
+| scipy | | \>=1.2.0| 1.8.1 |
+| shapely | | \>=1.6.4.post1| 1.8.2 |
+| wntr | | \>=0.1.6| 0.4.2 |
+| affine | | | 2.3.1 |
+| attrs | | | 21.4.0 |
+| certifi | | | 2022.6.15 |
+| click | | | 8.1.3 |
+| click-plugins | | | 1.1.1 |
+| cligj | | | 0.7.2 |
+| cycler | | | 0.11.0 |
+| ecdsa | | | 0.17.0 |
+| fonttools | | | 4.33.3 |
+| iniconfig | | | 1.1.1 |
+| kiwisolver | | | 1.4.3 |
+| munch | | | 2.5.0 |
+| packaging | | | 21.3 |
+| pillow | | | 9.1.1 |
+| pluggy | | | 1.0.0 |
+| ply | | | 3.11 |
+| pyasn1 | | | 0.4.8 |
+| pyparsing | | | 3.0.9 |
+| python-dateutil | | | 2.8.2 |
+| pytz | | | 2022.1 |
+| rsa | | | 4.8 |
+| six | | | 1.16.0 |
+| snuggs | | | 1.4.7 |
+| tomli | | | 2.0.1 |


Test patch:
diff --git a/pyincore/pyincore-test.ipynb b/pyincore/pyincore-test.ipynb
deleted file mode 100644
index 56d4ca9e2..000000000
--- a/pyincore/pyincore-test.ipynb
+++ /dev/null
@@ -1,373 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "# Demo prototypes of IN-CORE services\n",
-    "This notebook shows how to use prototypes of IN-CORE services by using pyincore library. This demo shows how you can use IN-CORE services with other python libraries"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": [
-    "from pyincore import FragilityService, DataService, HazardService, ComputeDamage\n",
-    "from pyincore import PlotUtil\n",
-    "from pyincore import InventoryDataset\n",
-    "import pprint\n",
-    "pp = pprint.PrettyPrinter(indent=4)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Using Data Service (http://localhost:8080/data/api/datasets)\n",
-    "* __get_datasets(...)__: retriving metadata with a query (by data type or/and by title)\n",
-    "* __get_dataset_metadata(...)__: retrieving metadata of dataset\n",
-    "* __get_dataset__: retrieving files of dataset"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### Find dataset that contains \"hospital\" in the title"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "scrolled": true
-   },
-   "outputs": [],
-   "source": [
-    "DataService.get_datasets('http://localhost:8080',title=\"hospital\")"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### Download the files of Hospital dataset"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "localfile = DataService.get_dataset('http://localhost:8080', '59f3617de1b2b828641a012a')\n",
-    "buildings = InventoryDataset(localfile)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### IN-CORE web service can work with other popular python library (e.g. GeoPandas) \n",
-    "The following shows plotting the dataset from IN-CORE web service by using GeoPandas"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": [
-    "import geopandas as gpd\n",
-    "gdf = gpd.GeoDataFrame.from_features(buildings.inventory_set)\n",
-    "#hospital= gpd.read_file('data/Hospitals1228337472406', layer='all_bldgs_ver5_WGS1984')"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "%matplotlib inline\n",
-    "import matplotlib.pylab as pylab\n",
-    "pylab.rcParams['figure.figsize'] = 8, 6\n",
-    "gdf.plot()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "## show Top 5 rows of attribute table of the Hospital dataset\n",
-    "gdf.head()"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### Showing hospital dataset (IN-CORE service) on Open Street Map by using GeoPandas and Folium"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "import folium\n",
-    "\n",
-    "m = folium.Map(location=[-89.88505, 35.220586])\n",
-    "folium.GeoJson(gdf.to_json(), name='hospital').add_to(m)\n",
-    "ext = gdf.total_bounds\n",
-    "m.fit_bounds([[ext[1], ext[0]], [ext[3], ext[2]]])\n",
-    "m"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Using Glossary Service (https://resilience-glossary.ncsa.illinois.edu)\n",
-    "* __get_term(...)__: retriving a term from the glossary service"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "from pyincore import GlossaryService\n",
-    "term = GlossaryService.get_term(\"https://resilience-glossary.ncsa.illinois.edu\", \"Q446\")\n",
-    "term.description"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "# Building Damage Estimation by using Data Service, Fragility Service, and Hazard Service \n",
-    "The following examples show how building damage can be computed by using Data Service, Fragility Service and Hazard Service. "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### Step 1. Retrive a building from Hospital dataset"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": [
-    "building = next(iter(buildings.inventory_set))"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### Step 2. Retrive a Fragility Curve Set\n",
-    "* The Fragility Service finds a fragility curve set with the structure attribute of the building"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "fragility_set = FragilityService.map_fragility('http://localhost:8080', building, \"Non-Retrofit Fragility ID Code\")\n",
-    "\n",
-    "## print the retrived fragility curve set\n",
-    "fragility_set"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "## Plot the fragility curve set\n",
-    "## plot the retrived f\n",
-    "import matplotlib.pyplot as plt\n",
-    "\n",
-    "for curve in fragility_set['fragilityCurves']:\n",
-    "    x,y = PlotUtil.get_x_y(curve['curveType'],curve['median'],curve['beta'])\n",
-    "    plt.plot(x,y, label=curve['description'])\n",
-    "plt.xlabel(fragility_set['demandType']+\" (\"+fragility_set['demandUnits']+\")\")\n",
-    "plt.legend()\n",
-    "plt.show()"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### Step 3: Getting Hazard Value at the location of the building\n",
-    "* Scenario earthquake has been created at the service with the following parameters:\n",
-    "    * AtkinsonBoore 1995\n",
-    "    * Epicenter (lat/lon): 35.927, -89.919\n",
-    "    * Magnitude: 7.9\n",
-    "    * Depth: 10.0\n",
-    "* Plot the scenario earthquake with sampling data from Hazard Service"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "import numpy as np\n",
-    "from scipy.interpolate import griddata\n",
-    "x, y, z = HazardService.get_hazard_value_set(\"http://localhost:8080\", \"59f8e10004c01e79c4a67a88\", \"PGA\", \"g\", [[-90.3099,34.9942],[-89.6231,35.4129]], 0.01696)\n",
-    "grid_x, grid_y = np.mgrid[min(x):max(x):100j, min(y):max(y):100j]\n",
-    "grid_z = griddata((x, y), z, (grid_x, grid_y), method='cubic')\n",
-    "contour_filled=plt.contourf(grid_x, grid_y, grid_z, 20, cmap=\"gist_rainbow_r\")\n",
-    "plt.colorbar(contour_filled)\n",
-    "plt.show()"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "* __Getting a hazard value at the location of the building by using Hazard Service__"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "latlon = building['geometry']['coordinates']\n",
-    "haz_val = HazardService.get_hazard_value(\"http://localhost:8080\", \"59f8e10004c01e79c4a67a88\", \"PGA\", \"g\", latlon[1], latlon[0])\n",
-    "haz_val"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "### Step 4. Compute limit states with the fragility curve sets and the hazard value"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "damage = ComputeDamage.calculate_limit_state2(fragility_set, haz_val)\n",
-    "damage"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## This demonstrates that IN-CORE web services can be used with popular python libraries (Statisitcs, Data analysis etc) "
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": [
-    "import numpy as np\n",
-    "from scipy import ndimage\n",
-    "def heatmap(d, bins=(100,100), smoothing=1.3, cmap='jet'):\n",
-    "    def getx(pt):\n",
-    "        return pt.coords[0][0]\n",
-    "\n",
-    "    def gety(pt):\n",
-    "        return pt.coords[0][1]\n",
-    "\n",
-    "    x = list(d.geometry.apply(getx))\n",
-    "    y = list(d.geometry.apply(gety))\n",
-    "    heatmap, xedges, yedges = np.histogram2d(y, x, bins=bins)\n",
-    "    extent = [yedges[0], yedges[-1], xedges[-1], xedges[0]]\n",
-    "\n",
-    "    logheatmap = np.log(heatmap)\n",
-    "    logheatmap[np.isneginf(logheatmap)] = 0\n",
-    "    logheatmap = ndimage.filters.gaussian_filter(logheatmap, smoothing, mode='nearest')\n",
-    "    \n",
-    "    plt.imshow(logheatmap, cmap=cmap, extent=extent)\n",
-    "    plt.colorbar()\n",
-    "    plt.gca().invert_yaxis()\n",
-    "    plt.show()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "localfile_res3 = DataService.get_dataset('http://localhost:8080', '59f36185e1b2b828641a0189')\n",
-    "res3 = InventoryDataset(localfile_res3)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "res3_gdf = gpd.GeoDataFrame.from_features(res3.inventory_set)\n",
-    "heatmap(res3_gdf, bins=100, smoothing=1.5)\n"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 3",
-   "language": "python",
-   "name": "python3"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 3
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython3",
-   "version": "3.7.3"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}