Skip to content

Commit

Permalink
Merge pull request #222 from SANDAG/update_release_version
Browse files Browse the repository at this point in the history
Automatically update release version in GUI and properties
  • Loading branch information
bhargavasana authored Oct 21, 2024
2 parents 3bc4922 + 94c1cc1 commit 52d29f5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/main/emme/toolbox/master_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,7 @@ def write_metadata(self, main_directory, scenario_title, select_link, username,
,"environment" : prod_env
,"network_path" : props["network"]
,"landuse_path" : props["landuse"]
,"release_path" : props["release"]
}
_m.logbook_write("Created new scenario_guid: %s" % (datalake_metadata_dict['scenario_guid']))
got_id, scenario_id = self.get_scenario_id(datalake_metadata_dict['scenario_guid'], scenario_title, prod_env)
Expand Down
3 changes: 2 additions & 1 deletion src/main/python/datalake_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def create_scenario_df(ts, EMME_metadata, parent_dir_name, output_path):
"select_link" : [EMME_metadata["select_link"]],
"sample_rate" : [EMME_metadata["sample_rate"]],
"network_path" : [EMME_metadata["network_path"]],
"landuse_path" : [EMME_metadata["landuse_path"]]
"landuse_path" : [EMME_metadata["landuse_path"]],
"release_path" : [EMME_metadata["release_path"]]
}

meta_df = pd.DataFrame(metadata)
Expand Down
20 changes: 8 additions & 12 deletions src/main/python/pythonGUI/createStudyAndScenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ def __init__(self, root, emme_version = "4.3.7", year = "2022", geo = "1", year_
divider=u"_"*200
if getattr(sys, 'frozen', False):
self.releaseDir=os.path.abspath(os.path.join(os.path.dirname(sys.executable), '..', '..'))
self.version=os.path.basename(os.path.abspath(os.path.join(os.path.dirname(sys.executable), '..')))
else:
self.releaseDir=os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..'))
self.version=os.path.basename(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')))
self.defaultScenarioDir="T:\\STORAGE-63T\\2025RP_init_concept\\"
self.defaultNetworkDir="T:\\projects\\sr15\\tned_etl\\2025RP_draft"
self.defaultLandUseDir="T:\\projects\\sr15\\land_use\\2025RP_draft"
Expand All @@ -80,7 +82,11 @@ def __init__(self, root, emme_version = "4.3.7", year = "2022", geo = "1", year_
self.buttonVar= tkinter.IntVar(root)
self.yButton=tkinter.Radiobutton(body, text="Yes", variable=self.buttonVar, value=1, command=self.initStudy)
self.nButton=tkinter.Radiobutton(body, text="No", variable=self.buttonVar, value=0,command=self.initStudy)
tkinter.Label(body, text=u"Release Version 15.2.0\n"+divider, font=("Helvetica", 11, 'bold'), width=50, fg='royal blue').grid(row=current_row,columnspan=5)
if self.version[:8] == "version_":
version_name = self.version[8:].replace("_",".",2)
else:
version_name = self.version
tkinter.Label(body, text=u"Release Version " + version_name + "\n"+divider, font=("Helvetica", 11, 'bold'), width=50, fg='royal blue').grid(row=current_row,columnspan=5)
current_row += 1
tkinter.Label(body, text=u"Create an ABM Work Space", font=("Helvetica", 10, 'bold')).grid(row=current_row,columnspan=n_columns)
current_row += 1
Expand Down Expand Up @@ -124,17 +130,6 @@ def __init__(self, root, emme_version = "4.3.7", year = "2022", geo = "1", year_
tkinter.Label(body, text=u"Create an ABM scenario", font=("Helvetica", 10, 'bold')).grid(row=current_row,columnspan=n_columns)
current_row += 1

#tkinter.Label(body, text=u"Version", font=("Helvetica", 8, 'bold')).grid(row=8)
#var = StringVar(root)
if getattr(sys, 'frozen', False):
self.version=os.path.basename(os.path.abspath(os.path.join(os.path.dirname(sys.executable), '..')))
else:
self.version=os.path.basename(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')))
#optionList=["version_14_2_2"]
#option=tkinter.OptionMenu(body,var,*optionList,command=self.setversion)
#option.config(width=50)
#option.grid(row=8, column=1)

tkinter.Label(body, text=u"Emme Version", font=("Helvetica", 8, 'bold')).grid(row=current_row)
var = tkinter.StringVar(root)
#self.emme_version = "4.4.4.1"
Expand Down Expand Up @@ -377,6 +372,7 @@ def executeBatch(self, type):
self.update_property("geographyID = 1", "geographyID = " + self.geo.get())
self.update_property("network = NETWORK", "network = " + self.networkpath.get())
self.update_property("landuse = LANDUSE", "landuse = " + self.lupath.get())
self.update_property("release = RELEASE", "release = " + self.releaseDir+"\\"+self.version)
elif type=="study":
studyyears = self.studyyears.get().split(',')
exclude_file = self.studynetworkpath.get() + '\\exclude.txt'
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/sandag_abm.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##SANDAG ABM Properties
##Software Version
version = version_15_2_0rc
release = RELEASE
landuse = LANDUSE
network = NETWORK
## geography ID
Expand Down

0 comments on commit 52d29f5

Please sign in to comment.