Skip to content

Commit

Permalink
Merge pull request #1 from JGCRI/tethys-change
Browse files Browse the repository at this point in the history
update to tethys nomenclature
  • Loading branch information
crvernon authored Jan 29, 2018
2 parents 5024d67 + 95185e1 commit a5ff0d0
Show file tree
Hide file tree
Showing 37 changed files with 97 additions and 95 deletions.
2 changes: 1 addition & 1 deletion DISCLAIMER
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
demeter-w
tethys

BSD 2-Clause - DISCLAIMER

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
demeter-w
tethys

BSD 2-Clause

Expand Down
6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include demeter_w/reference/dist.csv
include demeter_w/reference/obv_dom.csv
include demeter_w/reference/IEA_9_Countries_Monthly_AvgElectricity_2000_2015.csv
include tethys/reference/dist.csv
include tethys/reference/obv_dom.csv
include tethys/reference/IEA_9_Countries_Monthly_AvgElectricity_2000_2015.csv
70 changes: 35 additions & 35 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions example/config.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configuration file for Demeter-W V1.0.
# Configuration file for Tethys V1.0.
# Author: Xinya Li ([email protected])
# Modified: 09/09/2017
# License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Expand Down Expand Up @@ -26,7 +26,7 @@ PerformTemporal = 1

[GCAM]
# 2. GCAM database/csv files related
# UseGCAMDatabase: [1] use GCAM raw CSV files; [0] use files already processed in Demeter-W required format
# UseGCAMDatabase: [1] use GCAM raw CSV files; [0] use files already processed in Tethys required format
UseGCAMDatabase = 1
# The path to the database (basex) folder
GCAM_DBpath =
Expand Down
8 changes: 4 additions & 4 deletions example/example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected]); Chris R. Vernon ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand All @@ -11,16 +11,16 @@
"""

import os
from demeter_w.model import DemeterW
from tethys.model import Tethys


if __name__ == "__main__":

# get path to config.ini in the example dir
cfg = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config.ini')

# run the demeter-w model and save outputs
dmw = DemeterW(config=cfg)
# run the Tethys model and save outputs
dmw = Tethys(config=cfg)

# if needed, reuse the gridded data or gis data output by the model
grid_outputs = dmw.gridded_data
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ def get_requirements():
return f.read().split()

setup(
name='demeter-w',
name='tethys',
version='1.0.0',
description='Spatial and Temporal Downscaling of Global Water Demands',
url='https://github.com/JGCRI/demeter-w',
url='https://github.com/JGCRI/tethys',
packages=find_packages(),
license='BSD 2-Clause',
author='Xinya Li; Chris R. Vernon',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'''
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-WD V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
'''

from demeter_w.Utils.Logging import clearfolder
from tethys.Utils.Logging import clearfolder
import GCAMOutputs
import GCAMutil

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand All @@ -11,7 +11,7 @@
import os
import GCAMutil as util
import GCAMSupport as Support
from demeter_w.Utils.DataParser import getContentArray as ArrayCSVReader
from tethys.Utils.DataParser import getContentArray as ArrayCSVReader
from shutil import copyfile


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand All @@ -22,8 +22,8 @@
import numpy as np
from scipy import io as spio
#from netCDF4 import Dataset
from demeter_w.Utils.DataParser import GetArrayCSV, GetArrayTXT
from demeter_w.Utils.DataParser import getContentArray as ArrayCSVRead
from tethys.Utils.DataParser import GetArrayCSV, GetArrayTXT
from tethys.Utils.DataParser import getContentArray as ArrayCSVRead
from HistPopIrrData import getPopYearData as GetPopData
from HistPopIrrData import getIrrYearData as GetIrrData

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-WD V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
"""

import numpy as np
from demeter_w.Utils.DataParser import getTXTContentArray as ArrayTXTRead
from demeter_w.Utils.DataParser import getContentArray as ArrayCSVReader
from tethys.Utils.DataParser import getTXTContentArray as ArrayTXTRead
from tethys.Utils.DataParser import getContentArray as ArrayCSVReader

def getIrrYearData(settings):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-WD V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand All @@ -12,7 +12,7 @@
"""

import numpy as np
from demeter_w.DataWriter.OUTWriter import OUTSettings
from tethys.DataWriter.OUTWriter import OUTSettings

def compare_downscaled_GCAMinput(Settings, GCAMData, OUT):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand All @@ -14,7 +14,7 @@
"""
import os
import numpy as np
from demeter_w.Utils.DataParser import GetArrayCSV
from tethys.Utils.DataParser import GetArrayCSV
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.ticker import FormatStrFormatter
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand All @@ -19,9 +19,9 @@
"""

import numpy as np
from demeter_w.Utils.Math import SizeR, SizeC
from demeter_w.Utils.Math import ind2sub
from demeter_w.Utils.Math import sub2ind
from tethys.Utils.Math import SizeR, SizeC
from tethys.Utils.Math import ind2sub
from tethys.Utils.Math import sub2ind

def Rearranging(mapsize, GISData, rgnmapData):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
Expand All @@ -27,7 +27,7 @@
import scipy.io as spio
import os, calendar
import numpy as np
from demeter_w.Utils.DataParser import getContentArray as ArrayCSVRead
from tethys.Utils.DataParser import getContentArray as ArrayCSVRead
from NeighborBasin import NeighborBasin


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 12 additions & 10 deletions demeter_w/model.py → tethys/model.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected]); Chris R. Vernon ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
This is the DemeterW class of showing how to evaluate the input settings and
This is the Tethys class of showing how to evaluate the input settings and
call the function running water disaggregation
"""

import os, sys, time
import demeter_w.DataReader.IniReader as IniReader
from demeter_w.Utils.Logging import Logger
from demeter_w.DataWriter.OUTWriter import OutWriter
from demeter_w.run_disaggregation import run_disaggregation as disagg
import os
import sys
import time
import tethys.DataReader.IniReader as IniReader
from tethys.Utils.Logging import Logger
from tethys.DataWriter.OUTWriter import OutWriter
from tethys.run_disaggregation import run_disaggregation as disagg


class DemeterW:
class Tethys:

def __init__(self, config='config.ini'):

print "Demeter-W starts..."
print "Tethys starts..."

# instantiate functions
self.Disaggregation = disagg
Expand All @@ -48,7 +50,7 @@ def __init__(self, config='config.ini'):
sys.stdout.log.close()

sys.stdout = sys.__stdout__
print "Demeter-W ends."
print "Tethys ends."

def run_model(self):
"""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions demeter_w/run_disaggregation.py → tethys/run_disaggregation.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
"""
@Date: 09/09/2017
@author: Xinya Li ([email protected])
@Project: Demeter-W V1.0
@Project: Tethys V1.0
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
Copyright (c) 2017, Battelle Memorial Institute
"""

import time
from demeter_w.DataReader.GCAMOutputs import getGCAMData
from demeter_w.DataReader import GISReader
from demeter_w.DataWriter.OUTWriter import OUTSettings
from demeter_w.SpatialDownscaling.ProxyMaps import Rearranging
import demeter_w.SpatialDownscaling.ProxyMaps as ProxyMaps
import demeter_w.SpatialDownscaling.TotalWaterUse as TotalWaterUse
import demeter_w.Diagnostics.Spatial as DiagnosticsSD
import demeter_w.Diagnostics.Temporal as DiagnosticsTD
import demeter_w.TemporalDownscaling.TemporalDownscaling as TemporalDownscaling
from tethys.DataReader.GCAMOutputs import getGCAMData
from tethys.DataReader import GISReader
from tethys.DataWriter.OUTWriter import OUTSettings
from tethys.SpatialDownscaling.ProxyMaps import Rearranging
import tethys.SpatialDownscaling.ProxyMaps as ProxyMaps
import tethys.SpatialDownscaling.TotalWaterUse as TotalWaterUse
import tethys.Diagnostics.Spatial as DiagnosticsSD
import tethys.Diagnostics.Temporal as DiagnosticsTD
import tethys.TemporalDownscaling.TemporalDownscaling as TemporalDownscaling


def run_disaggregation(settings):
Expand All @@ -27,7 +27,7 @@ def run_disaggregation(settings):
Module: run_disaggregation
Main Function of Demeter-W: Steps for water disaggregation
Main Function of Tethys Steps for water disaggregation
1. Read in the GCAM Data and Get the number of years
2. Read in the GIS data
3. Rearranging data and map indices
Expand Down

0 comments on commit a5ff0d0

Please sign in to comment.