Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion examples/3zone_toy/outputs/total_cost.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
112306455.975
114415586.323
2 changes: 1 addition & 1 deletion examples/carbon_cap/outputs/total_cost.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
117115037.675
119224168.023

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ S-Geothermal 1998 1.0
S-Central_PV-1 2020 0.0
S-Central_PV-1 2000 1.0
S-NG_CC 2000 5.0
S-NG_CC 2020 1.84427579787234
S-NG_CC 2020 2.34276595744681
S-Geothermal 2020 0.0
7 changes: 0 additions & 7 deletions examples/copperplate0/outputs/DispatchProj.tab

This file was deleted.

3 changes: 0 additions & 3 deletions examples/copperplate0/outputs/DumpPower.tab

This file was deleted.

3 changes: 0 additions & 3 deletions examples/copperplate0/outputs/ProjFuelUseRate.tab

This file was deleted.

6 changes: 3 additions & 3 deletions examples/copperplate0/outputs/dispatch.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
timestamp S-Geothermal S-NG_CC S-Central_PV-1
2025011512 0.5 6.9022 0.5978
2025011600 0.5 0 0
timestamp S-Central_PV-1 S-Geothermal S-NG_CC
2025011512 0.5978 0.5 6.9022
2025011600 0 0.5 0
2 changes: 1 addition & 1 deletion examples/planning_reserves/outputs/total_cost.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
113475282.655
115584413.003
2 changes: 1 addition & 1 deletion examples/rps_simple/outputs/total_cost.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
117916387.239
120025517.587
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@
import os
from setuptools import setup, find_packages

# Get the version number. Strategy #3 from https://packaging.python.org/single_source_version/
version_path = os.path.join(os.path.dirname(__file__), 'switch_model', 'version.py')
version = {}
with open(version_path) as f:
exec(f.read(), version)
__version__ = version['__version__']

def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()

setup(
name='switch_model',
version='2.0.0b2',
version=__version__,
maintainer='Switch Authors',
maintainer_email='[email protected]',
url='http://switch-model.org',
Expand Down
2 changes: 1 addition & 1 deletion switch_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Most applications of Switch will also benefit from optional modules such as
transmission, local_td, reserves, etc.
"""
__version__='2.0.0b2'
from .version import __version__
core_modules = [
'switch_model.timescales',
'switch_model.financials',
Expand Down
6 changes: 5 additions & 1 deletion switch_model/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"""Script to handle switch <cmd> calls from the command line."""

import sys, os
import switch_model

# print "running {} as {}.".format(__file__, __name__)

def main():
cmds = ["solve", "solve-scenarios", "test", "upgrade"]
cmds = ["solve", "solve-scenarios", "test", "upgrade", "--version"]
if len(sys.argv) >= 2 and sys.argv[1] in cmds:
# If users run a script from the command line, the location of the script
# gets added to the start of sys.path; if they call a module from the
Expand All @@ -23,6 +24,9 @@ def main():
cmd = sys.argv[1]
sys.argv[0] += " " + cmd
del sys.argv[1]
if cmd == "--version":
print "Switch model version " + switch_model.__version__
return 0
if cmd == "solve":
from .solve import main
elif cmd == "solve-scenarios":
Expand Down
2 changes: 1 addition & 1 deletion switch_model/transmission/transport/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def define_components(mod):
within=mod.BLD_YRS_FOR_TX,
initialize=lambda m, p: set(
(tx, bld_yr) for (tx, bld_yr) in m.BLD_YRS_FOR_TX
if bld_yr <= p))
if bld_yr == 'Legacy' or bld_yr <= p))

def bounds_BuildTx(model, tx, bld_yr):
if((tx, bld_yr) in model.BLD_YRS_FOR_EXISTING_TX):
Expand Down
9 changes: 9 additions & 0 deletions switch_model/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2015-2017 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0, which is in the LICENSE file.
"""
This file should only include the version. Do not import any packages or
modules in here because this file needs to be executed before SWITCH is
installed and executed in environments that don't have any dependencies
installed.
"""
__version__='2.0.0b3'
2 changes: 1 addition & 1 deletion tests/upgrade_dat/3zone_toy/outputs/total_cost.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
112306455.975
114415586.323