Skip to content

Commit

Permalink
Move demo data into package directory (#90)
Browse files Browse the repository at this point in the history
* data: move all files required for climada_petals package to climada_petals/data
* adapt setup.py
* include FR_DE_DEMO file in package
  • Loading branch information
emanuel-schmid committed Aug 21, 2023
1 parent 19f77e6 commit 8fa1529
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 18 deletions.
16 changes: 11 additions & 5 deletions climada_petals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,29 @@
from .util.constants import *

REPO_DATA = {
'data/system': [
'climada_petals/data/gdp_asset': [
SYSTEM_DIR.joinpath('GDP2Asset_converter_2.5arcmin.nc'),
DEMO_GDP2ASSET,
],
'data/demo': [
'climada_petals/data/river_flood': [
HAZ_DEMO_FLDDPH,
HAZ_DEMO_FLDFRC,
DEMO_GDP2ASSET,
],
'climada_petals/data/crop_production': [
DEMO_DIR.joinpath('crop_production_demo_data_yields_CHE.nc4'),
DEMO_DIR.joinpath('crop_production_demo_data_cultivated_area_CHE.nc4'),
DEMO_DIR.joinpath('FAOSTAT_data_producer_prices.csv'),
DEMO_DIR.joinpath('FAOSTAT_data_production_quantity.csv'),
DEMO_DIR.joinpath('gepic_gfdl-esm2m_ewembi_historical_2005soc_co2_yield-whe-noirr_global_DEMO_TJANJIN_annual_1861_2005.nc'),
DEMO_DIR.joinpath('hist_mean_mai-firr_1976-2005_DE_FR.hdf5'),
DEMO_DIR.joinpath('histsoc_landuse-15crops_annual_FR_DE_DEMO_2001_2005.nc'),
DEMO_DIR.joinpath('lpjml_ipsl-cm5a-lr_ewembi_historical_2005soc_co2_yield-whe-noirr_annual_FR_DE_DEMO_1861_2005.nc'),
],
'climada_petals/data/relative_cropyield': [
DEMO_DIR.joinpath('gepic_gfdl-esm2m_ewembi_historical_2005soc_co2_yield-whe-noirr_global_DEMO_TJANJIN_annual_1861_2005.nc'),

Check warning on line 46 in climada_petals/__init__.py

View check run for this annotation

Jenkins - WCR / Pylint

line-too-long

LOW: Line too long (132/100)
Raw output
Used when a line is longer than a given number of characters.
DEMO_DIR.joinpath('pepic_miroc5_ewembi_historical_2005soc_co2_yield-whe-firr_global_annual_DEMO_TJANJIN_1861_2005.nc'),

Check warning on line 47 in climada_petals/__init__.py

View check run for this annotation

Jenkins - WCR / Pylint

line-too-long

LOW: Line too long (127/100)
Raw output
Used when a line is longer than a given number of characters.
DEMO_DIR.joinpath('pepic_miroc5_ewembi_historical_2005soc_co2_yield-whe-noirr_global_annual_DEMO_TJANJIN_1861_2005.nc'),

Check warning on line 48 in climada_petals/__init__.py

View check run for this annotation

Jenkins - WCR / Pylint

line-too-long

LOW: Line too long (128/100)
Raw output
Used when a line is longer than a given number of characters.
DEMO_DIR.joinpath('lpjml_ipsl-cm5a-lr_ewembi_historical_2005soc_co2_yield-whe-noirr_annual_FR_DE_DEMO_1861_2005.nc'),

Check warning on line 49 in climada_petals/__init__.py

View check run for this annotation

Jenkins - WCR / Pylint

line-too-long

LOW: Line too long (125/100)
Raw output
Used when a line is longer than a given number of characters.
],
'climada_petals/data/wildfire': [
DEMO_DIR.joinpath('Portugal_firms_June_2017.csv'),
DEMO_DIR.joinpath('Portugal_firms_2016_17_18_MODIS.csv'),
]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 6 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,31 @@
"""

from pathlib import Path
from setuptools import setup, find_packages
from setuptools import setup, find_namespace_packages

here = Path(__file__).parent.absolute()

# Get the long description from the README file
with open(here / 'doc/misc/README.md', encoding='utf-8') as f:
long_description = f.read()

# Add configuration files
extra_files = [str(here / 'climada_petals/conf/climada.conf'), str(here / 'doc/misc/README.md')]

setup(
name='climada_petals',

version='3.3.0',

description='CLIMADA in Python',
description='CLIMADA Extensions in Python',

long_description=long_description,
long_description_content_type='text/markdown',

url='https://github.com/davidnbresch/climada_python',
url='https://github.com/CLIMADA-project/climada_python',

author='ETH',

license='OSI Approved :: GNU General Public License v3 (GPLv3)',

classifiers=[
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering :: Atmospheric Science',
Expand All @@ -42,14 +36,13 @@

keywords='climate adaptation',

packages=find_packages(where='.'),

install_requires=[
'climada',
'scikit-image',
],

package_data={'': extra_files},
packages=find_namespace_packages(include=['climada_petals*']),

include_package_data=True
setup_requires=['setuptools_scm'],
include_package_data=True,
)

0 comments on commit 8fa1529

Please sign in to comment.