Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #104 from sunt05/dev-test
Browse files Browse the repository at this point in the history
Dev test
  • Loading branch information
sunt05 authored Aug 30, 2019
2 parents 93c4ce3 + f2082d3 commit 9287b7c
Show file tree
Hide file tree
Showing 13 changed files with 57,457 additions and 56,514 deletions.
33,599 changes: 16,927 additions & 16,672 deletions docs/source/tutorial/external-interaction.ipynb

Large diffs are not rendered by default.

3,204 changes: 1,939 additions & 1,265 deletions docs/source/tutorial/impact-studies-parallel.ipynb

Large diffs are not rendered by default.

76,362 changes: 38,083 additions & 38,279 deletions docs/source/tutorial/quick-start.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/source/version-history/20190829.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Version 20190829

1. ESTM is not supported yet.
2. BLUEWS, a CBL modules in SUEWS, is not supported yet.
3. Performance in parallel mode can be worse than
serial mode sometimes due to heavy (de)-serialisation loads.



34 changes: 34 additions & 0 deletions docs/source/version-history/dev.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _new_latest:


Version dev
======================================================


- **New**

None.

- **Improvement**

1. Improved performance of the parallel mode.

- **Changes**

None.


- **Fix**

None.


- **Known issue**

1. ESTM is not supported yet.
2. BLUEWS, a CBL modules in SUEWS, is not supported yet.
3. Performance in parallel mode is NOT supported on Windows
due to system limitation.



1 change: 1 addition & 0 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def readme():
install_requires=[
'numpy>=1.15.2',
'pandas>=0.25.1',
'tables', # for dumping in hdf5
'scipy',
'dask[complete]', # needs all dask and its dependencies
'f90nml',
Expand Down
21 changes: 11 additions & 10 deletions src/supy/_load.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from scipy.interpolate import interp1d
import functools
import logging
from ast import literal_eval
from datetime import timedelta
from multiprocessing import cpu_count
Expand All @@ -9,6 +9,7 @@
import numpy as np
import pandas as pd
from dask import dataframe as dd
from scipy.interpolate import interp1d
from supy_driver import suews_driver as sd

from ._env import path_supy_module
Expand Down Expand Up @@ -226,8 +227,7 @@ def load_SUEWS_nml(path_file):
df_res = pd.DataFrame(f90nml.read(str_file))
return df_res
except FileNotFoundError:
print('{path} does not exists!'.format(path=path_file))

logging.exception(f'{path_file} does not exists!')

# def load_SUEWS_RunControl(path_file):
# lib_RunControl = load_SUEWS_nml(path_file)
Expand All @@ -242,7 +242,7 @@ def load_SUEWS_table(path_file):
try:
path_file = path_file.resolve()
except FileNotFoundError:
print('{path} does not exists!'.format(path=path_file))
logging.exception(f'{path_file} does not exists!')
else:
# fileX = path_insensitive(fileX)
str_file = str(path_file)
Expand Down Expand Up @@ -802,7 +802,8 @@ def gather_code_set(code, dict_var2SiteSelect):
elif isinstance(v, dict):
set_res.update(v.keys())
else:
print(k, v)
logging.info(f'{k},{v}')

elif isinstance(v, dict):
# print(res,v)
set_res.update(list(gather_code_set(code, v)))
Expand Down Expand Up @@ -843,10 +844,10 @@ def build_code_df(code, path_input, df_base):
try:
df_code = df_code0.loc[list_code, list_keys]
except Exception as e:
print('Entries missing from {lib}'.format(lib=lib_code))
print('\nlist_code:\n', list_code, '\n', df_code0.index)
print('\nlist_keys\n', list_keys, '\n', df_code0.columns)

logging.exception(f'Entries missing from {lib_code}')
logging.exception(f'list_code:\n {list_code} \n {df_code0.index}')
logging.exception(f'list_keys:\n {list_keys} \n {df_code0.columns}')
logging.exception(f'Entries missing from {lib_code}')
raise e

df_code.index = df_base.index
Expand Down Expand Up @@ -1562,7 +1563,7 @@ def load_InitialCond_grid_df(path_runcontrol, force_reload=True):
lookup_KeySeq_lib.cache_clear()
gen_all_code_df.cache_clear()
build_code_exp_df.cache_clear()
print('All cache cleared.')
logging.info('All cache cleared.')

# load base df of InitialCond
df_init = load_SUEWS_InitialCond_df(path_runcontrol)
Expand Down
Loading

0 comments on commit 9287b7c

Please sign in to comment.