diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7730d4b572b701094b69b95277d964e824eb3d8e..512c94cc1b2e2f03b196036107f431711b7b0f81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,13 +14,8 @@ before_script: - virtualenv venv - source venv/bin/activate - pip3 install . - # - pip3 install .[tests] linters: script: - pip3 install .[linters] - make check - -#tests: -# script: -# - pytest tests diff --git a/Makefile b/Makefile index f9c6c2c3d55ebba25080c9003442863e8cdcf7d9..2afe68fa59506787df0741deb455249010d773f9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SOURCES=losscalculator +SOURCES=losscalculator setup.py LENGTH=96 check: $(SOURCES) diff --git a/README.md b/README.md index 2395c6990365bebbd2d3c311be79327190c8c515..6683ef23933b14d9f1b5bc588594bfd6a3cebd46 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,59 @@ -# Welcome to the loss calculator! +# losscalculator + +This program computes the probabilities of occurence of different damage-states for scenario +earthquakes, given a ground-motion field, an exposure model representing the assets in the +region of interest and fragility functions that model the probability of exceeding different +damage-states given an intensity measure level. + + +## Requirements + +* python3 +* pandas +* numpy +* scipy + + +## Usage + +Please run the command below to run a scenario damage calculation: + +`python3 damage_calculator -m interpolation_method -x exposure_type -f fragility_functions_pathname -t taxonomy_conversion_filepath -g ground_motion_filepath -c unique_tile_ids_filepath -e exposure_filepath -p polygons_source_filepath -r result_filepath` + +You could skip options -m, -x and -r for which the default is set to "linear","cell" and "damage_result.gpkg" respectively. + +To overwrite the result file, add -o option. + +For more information on the inputs and how to run a damage calculation, please check `python3 damage_calculator --help` + ## Copyright and copyleft Copyright (C) 2020 -Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ + +* Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, but +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License +You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/. + Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer - network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. -See the [LICENSE](./LICENSE) for the full license text. +See the [LICENSE](./LICENSE) for the full license text. diff --git a/setup.py b/setup.py index 8fb5e4cef6b75609515c4adf80e7b87a7065f4d2..0962c94ff30157aa17f229c0d44d5517d2301c00 100644 --- a/setup.py +++ b/setup.py @@ -2,20 +2,22 @@ from setuptools import setup, find_packages -tests_require = ["pytest", "pytest-asyncio", "pytest-docker", "requests", "pytest-celery"] +tests_require = ["pytest"] linters_require = ["black>=20.8b1", "pylint", "flake8"] setup( - name="lossCalculator", + name="losscalculator", version="0.1", - description="This program computes the probabilities of occurence of different damage states for a scenario earthquake, given a ground-motion field for the area, an exposure model representing the assets in the region of interest and fragility functions that show the probability of exceeding a set of damage states, given an intensity measure level", + description="Compute damage-state probabilities for assets in scenario earthquakes", license="AGPLv3+", install_requires=["pandas", "numpy", "scipy"], extras_require={ - #"tests": tests_require, + "tests": tests_require, "linters": linters_require, }, packages=find_packages(), - entry_points={"console_scripts": ["losscalculator = losscalculator.damage_calculator:main"]}, + entry_points={ + "console_scripts": ["losscalculator = losscalculator.damage_calculator:main"] + }, python_requires=">=3.6", )