Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4d2d2f3
avoid negative frequencies
aleeciu Jun 5, 2023
226f3e0
remove frequency correction
aleeciu Jun 5, 2023
047b589
remove intensity correction factors
aleeciu Jun 5, 2023
2da114f
remove use of "variable" key
aleeciu Jun 5, 2023
95e6c6e
add non-signficant changes plus correct error in increase percentage …
aleeciu Jun 5, 2023
1b17477
fix freq correction
aleeciu Jun 5, 2023
29fb1a1
fix bug in test: assert true should be assert equal
aleeciu Jun 6, 2023
288c2ed
update test due to application of only freq changes - and sometime ne…
aleeciu Jun 6, 2023
fdac719
adapt tests in TropCyclone
aleeciu Jun 6, 2023
f1934f9
fix name and adapt climate scenario test
aleeciu Jun 6, 2023
50a6fd7
reinsert check that no neg freq are modeled
aleeciu Jun 6, 2023
2e8152b
Merge branch 'develop' into feature/fix_knutson_scaling
emanuel-schmid Jun 26, 2023
cd0f286
test_trop_cyclone: adaptation to tag refactoring
emanuel-schmid Jun 26, 2023
c04b7dc
pylint
emanuel-schmid Jun 26, 2023
0718f2c
Merge branch 'develop' into feature/fix_knutson_scaling
emanuel-schmid Jul 3, 2023
e12b58f
throw warning when negative freq
aleeciu Jul 11, 2023
3f5e4a7
handle neg freq_scaling; refactor code
aleeciu Jul 11, 2023
20466bd
Merge branch 'develop' into feature/fix_knutson_scaling
aleeciu Oct 19, 2023
3c55332
new tc scaling
aleeciu Oct 19, 2023
cc49358
(partial) tests update
aleeciu Oct 19, 2023
2a4b05e
Merge branch 'develop' into feature/fix_knutson_scaling
aleeciu Nov 3, 2023
a5a1058
changes in docstrings, gsmt output as dict, percentiles as string
aleeciu Nov 6, 2023
034f8d0
fix typo in dict assignment
aleeciu Nov 6, 2023
8681975
Merge branch 'develop' into feature/fix_knutson_scaling
aleeciu Nov 6, 2023
8563c83
add info on available percentiles
aleeciu Nov 7, 2023
8726b2a
add lost function
aleeciu Nov 7, 2023
157414b
coherent baseline argument
aleeciu Nov 8, 2023
8200a54
adapt tests to new implementation
aleeciu Nov 8, 2023
6cc431a
update tutorial
aleeciu Nov 8, 2023
dbbd713
update tests
aleeciu Nov 8, 2023
1e7c460
change docstring order, remove default values, change ref_year to tar…
aleeciu Nov 22, 2023
23e7404
update tests
aleeciu Nov 22, 2023
23cca89
Format with black
peanutfun Apr 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 41 additions & 21 deletions climada/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,64 @@

climada init
"""

from shutil import copyfile
from pathlib import Path

from .util.config import CONFIG
from .util.constants import *


GSDP_DIR = SYSTEM_DIR.joinpath('GSDP')
GSDP_DIR = SYSTEM_DIR.joinpath("GSDP")

REPO_DATA = {
'climada/data/system': [
"climada/data/system": [
ISIMIP_GPWV3_NATID_150AS,
GLB_CENTROIDS_MAT,
ENT_TEMPLATE_XLS,
HAZ_TEMPLATE_XLS,
RIVER_FLOOD_REGIONS_CSV,
NATEARTH_CENTROIDS[150],
NATEARTH_CENTROIDS[360],
SYSTEM_DIR.joinpath('WEALTH2GDP_factors_CRI_2016.csv'),
SYSTEM_DIR.joinpath('GDP_TWN_IMF_WEO_data.csv'),
SYSTEM_DIR.joinpath('FAOSTAT_data_country_codes.csv'),
SYSTEM_DIR.joinpath('rcp_db.xls'),
SYSTEM_DIR.joinpath('tc_impf_cal_v01_TDR1.0.csv'),
SYSTEM_DIR.joinpath('tc_impf_cal_v01_EDR.csv'),
SYSTEM_DIR.joinpath('tc_impf_cal_v01_RMSF.csv'),
SYSTEM_DIR.joinpath("WEALTH2GDP_factors_CRI_2016.csv"),
SYSTEM_DIR.joinpath("GDP_TWN_IMF_WEO_data.csv"),
SYSTEM_DIR.joinpath("FAOSTAT_data_country_codes.csv"),
SYSTEM_DIR.joinpath("rcp_db.xls"),
SYSTEM_DIR.joinpath("tc_impf_cal_v01_TDR1.0.csv"),
SYSTEM_DIR.joinpath("tc_impf_cal_v01_EDR.csv"),
SYSTEM_DIR.joinpath("tc_impf_cal_v01_RMSF.csv"),
],
'climada/data/system/GSDP': [
GSDP_DIR.joinpath(f'{cc}_GSDP.xls')
for cc in ['AUS', 'BRA', 'CAN', 'CHE', 'CHN', 'DEU', 'FRA', 'IDN', 'IND', 'JPN', 'MEX',
'TUR', 'USA', 'ZAF']
"climada/data/system/GSDP": [
GSDP_DIR.joinpath(f"{cc}_GSDP.xls")
for cc in [
"AUS",
"BRA",
"CAN",
"CHE",
"CHN",
"DEU",
"FRA",
"IDN",
"IND",
"JPN",
"MEX",
"TUR",
"USA",
"ZAF",
]
],
'climada/data/demo': [
"climada/data/demo": [
ENT_DEMO_TODAY,
ENT_DEMO_FUTURE,
EXP_DEMO_H5,
HAZ_DEMO_FL,
HAZ_DEMO_MAT,
HAZ_DEMO_H5,
TC_ANDREW_FL,
DEMO_DIR.joinpath('demo_emdat_impact_data_2020.csv'),
DEMO_DIR.joinpath('nl_rails.gpkg'),
] + WS_DEMO_NC
DEMO_DIR.joinpath("demo_emdat_impact_data_2020.csv"),
DEMO_DIR.joinpath("nl_rails.gpkg"),
]
+ WS_DEMO_NC,
}


Expand All @@ -68,10 +84,13 @@ def test_installation():
If the invoked tests pass and an OK is printed out, the installation was successfull.
"""
from unittest import TestLoader, TextTestRunner
suite = TestLoader().discover(start_dir='climada.engine.test',
pattern='test_cost_benefit.py')
suite.addTest(TestLoader().discover(start_dir='climada.engine.test',
pattern='test_impact.py'))

suite = TestLoader().discover(
start_dir="climada.engine.test", pattern="test_cost_benefit.py"
)
suite.addTest(
TestLoader().discover(start_dir="climada.engine.test", pattern="test_impact.py")
)
TextTestRunner(verbosity=2).run(suite)


Expand All @@ -98,4 +117,5 @@ def setup_climada_data(reload=False):
src = Path(__file__).parent.parent.joinpath(src_dir, path.name)
copyfile(src, path)


setup_climada_data()
2 changes: 1 addition & 1 deletion climada/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.0.2-dev'
__version__ = "4.0.2-dev"
3 changes: 2 additions & 1 deletion climada/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

init engine
"""

from .impact import *
from .cost_benefit import *
from .impact_calc import *
from .impact_calc import *
Loading