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

Commit

Permalink
Upgrade pole model (#1133)
Browse files Browse the repository at this point in the history
* Create mdb-ami2glm-load.py

* Add sump pump to enduse loads

* Add sump state implementation

* Add sump enduse loadshape

* Revert "Add sump enduse loadshape"

This reverts commit 404995f.

* Create test_sump.glm

* Add sump to enduse schedules

* Add curtailable enduses global variable

* Add curtailment control global

* Add loadshape output command

* Add --loadshape command line option

* Add test_sump.glm

* Fix python setup

* Fix curtailment

* Fix linux build warnings

* Update cmdarg.cpp

* Disable dishwasher validation test because it doesn't work

* Fix enduse loadshape validation tests

* Update house model sump implementation

* Update billing.csv

* Update curtailment and sump docs and tests

* Create mdb-ami2glm-load.py

* Add general MDB converters

* Create mdb_info.py

* Update Makefile.mk

* Update mdb_info.py

* Create rbsa_single_family_2011.mdb

* Create ceus.glm

* Create config.glm

* Create ica_test.glm

* Create modify.glm

* Create build.h

* Create config.h

* Create config.h.in

* Create config.h.in~

* Create IEEE-123-cyme.png

* Create IEEE-13-cyme.png

* Create solver_nr_profile.csv

* Create table2glm_input.glm

* Create table2glm_input_noclass.glm

* Create table2glm_input_noname.glm

* Create gridlabd

* Create stamp-h1

* Update pole.cpp

* Update pole.h

* Update pole_configuration.cpp

* Update pole_mount.cpp

* Update pole_mount.h

* Update test_pole.csv

* Update Makefile.mk

* Update requirements.txt

* Update requirements.txt

* Update mdb_info.py

* MDB2GLM work progress

* Finish mdb-table to glm-object converter

* Update mdb-table2csv-player.py

* Add covered conductor

* Update load.cpp

* Work in progress

* Delete ami_data.mdb.gz

* Fix access to test data

* Update player.cpp

* Update load.cpp

* Update .gitignore

* Update load.cpp

* Update mdb-table2glm-player.py

* Create IEEE-13-cyme.glm

* Update test_mdbtable2glmobject.glm

* Create test_mdbtable2glmplayer.csv

* Update test_mdbtable2glmplayer.glm

* Update .gitignore

* Delete ami_data.glm

* Update IEEE-13-cyme.glm

* Update test_mdbtable2glmobject.glm

* Fix resolver

* Fix object name resolution

* Update test_create_poles.glm

* Fix requirements

* Update metrics.cpp

* Fix mdbtools usage in converters

* Update test_mdbtable2glmobject.glm

* Update xls-spida2csv-geodata.py

* Update test_xls-spida2csv-geodata.csv

* Update test_xls-spida2csv-geodata.csv

* Update json2html.py

* Update json2html_config.py

* Update xls-spida2csv-geodata.py

* Update Makefile.am

* Update pole_mount.cpp

* Update Makefile.am

* Update test_pole.csv

* Update create_poles.py

* Update noaa_forecast.py

* Update pole.cpp

Co-authored-by: David P. Chassin <[email protected]>
Co-authored-by: Alyona Teyber <[email protected]>
Co-authored-by: David P. Chassin <[email protected]>
  • Loading branch information
4 people authored Apr 8, 2022
1 parent 6449ae5 commit 1cb2048
Show file tree
Hide file tree
Showing 29 changed files with 23,657 additions and 8,970 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ $(PREFIX)/docker.img: docker/Dockerfile Makefile

system: python-install install
@echo "Setting $$($(top_srcdir)/build-aux/version.sh --install) to the current system version"
# @$(DESTDIR)$(bindir)/gridlabd docker disable > /dev/null
@$(DESTDIR)$(bindir)/gridlabd version set
@if [ ! "$$(gridlabd --version=install)" == "$$($(top_srcdir)/build-aux/version.sh --install)" ]; then \
echo 'WARNING : build and install versions differ; run `make reconfigure` to fix this problem'; \
Expand Down
16 changes: 8 additions & 8 deletions converters/autotest/test_xls-spida2csv-geodata.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class,pole_length,pole_depth,ground_diameter,fiber_strength,name,tilt_angle,tilt_direction,latitude,longitude,configuration,weather,flags
class,pole_length,pole_depth,ground_diameter,fiber_strength,name,tilt_angle,tilt_direction,latitude,longitude,configuration,wind_speed,flags
pole_configuration,40.0 ft,5.5 ft,9.87 in,8000 psi,pole_configuration_267462S,,,,,,,
pole_configuration,50.0 ft,7.5 ft,,8000 psi,pole_configuration_280565E,,,,,,,
pole_configuration,50.0 ft,7.5 ft,12.18 in,8000 psi,pole_configuration_280565E,,,,,,,
pole_configuration,45.0 ft,6.5 ft,12.41 in,8000 psi,pole_configuration_306771E,,,,,,,
pole_configuration,50.0 ft,8.5 ft,,8000 psi,pole_configuration_311032S,,,,,,,
pole_configuration,50.0 ft,8.5 ft,13.13 in,8000 psi,pole_configuration_311032S,,,,,,,
pole_configuration,45.0 ft,7.67 ft,12.41 in,8000 psi,pole_configuration_312148E,,,,,,,
pole,,,,,pole_267462S,0 deg,0 deg,34.4002833340685,-116.962349732192,pole_configuration_267462S,weather,NONE
pole,,,,,pole_280565E,0 deg,0 deg,33.9459351039498,-117.896961270715,pole_configuration_280565E,weather,NONE
pole,,,,,pole_306771E,0 deg,0 deg,33.5318268108841,-117.767614658085,pole_configuration_306771E,weather,NONE
pole,,,,,pole_311032S,0 deg,0 deg,33.84445388,-117.28241728,pole_configuration_311032S,weather,NONE
pole,,,,,pole_312148E,0 deg,0 deg,36.1926329370634,-119.158966357457,pole_configuration_312148E,weather,NONE
pole,,,,,pole_267462S,0 deg,0 deg,34.4002833340685,-116.962349732192,pole_configuration_267462S,0 m/s,NONE
pole,,,,,pole_280565E,0 deg,0 deg,33.9459351039498,-117.896961270715,pole_configuration_280565E,0 m/s,NONE
pole,,,,,pole_306771E,0 deg,0 deg,33.5318268108841,-117.767614658085,pole_configuration_306771E,0 m/s,NONE
pole,,,,,pole_311032S,0 deg,0 deg,33.84445388,-117.28241728,pole_configuration_311032S,0 m/s,NONE
pole,,,,,pole_312148E,0 deg,0 deg,36.1926329370634,-119.158966357457,pole_configuration_312148E,0 m/s,NONE
5 changes: 5 additions & 0 deletions converters/json2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ def get_color(tag):
except Exception as err:
pass

# try pole scheme
try:
return pole_colors[tag['status']]
except:
pass
return 'gray'

def get_popup(name,tag):
Expand Down
8 changes: 8 additions & 0 deletions converters/json2html_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@
'emergency' : 'red',
}

#
# Pole colors are based on value of status property
#
pole_colors = {
'OK' : 'black',
'FAILED' : 'red'
}

#
# Hidden properties
#
Expand Down
32 changes: 21 additions & 11 deletions converters/xls-spida2csv-geodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def convert(input_file, output_file, options={}):
df_pole_config.loc[:,'name'] = pole_configuration_name
df_pole_library.loc[:,'configuration'] = pole_configuration_name
df_pole_library.loc[:,'name'] = pole_name
df_pole_library.loc[:,'weather'] = 'weather'
df_pole_library.loc[:,'wind_speed'] = '0 m/s'
df_pole_library.loc[:,'flags'] = 'NONE'
df['Design - Pole']= pd.concat([df_pole_config, df_pole_library], axis=0, ignore_index=True)

Expand Down Expand Up @@ -202,27 +202,37 @@ def parse_length(cell_string, current_column, current_row):

# Keeps track of the units that are in the cell. Whichever unit is listed first in length_units AND is present in the string is the unit that will be used as the output.
cell_units = []

units_positions = []
num_strings = []
for key in length_units.keys():
if key in cell_string:
cell_units.append(length_units[key])

cell_numbers = re.findall('\d+[\.]?[\d+]*', cell_string)
cell_units.append(length_units[key])
units_positions.append(cell_string.find(key))
last_pos = 0
for units_position in units_positions:
num_strings.append(cell_string[last_pos:units_position])
last_pos = units_position+1

if len(cell_units) == 0:
raise ValueError(f'Please specify valid units for {cell_string} in column: {current_column}, row {current_row}.')

if len(cell_numbers) != len(cell_units):
if len(num_strings) != len(cell_units):
raise ValueError(f'Please make sure there are the same number of numbers and units for value {cell_string} in column: {current_column}, row {current_row}')



cell_numbers = re.findall('\d+[\./]?[\d+]*', cell_string)

# Convert all the units and values in the cell to one unit and value.
total_cell_value = 0
for i in range(0,len(cell_numbers)):
convert_to = length_conversions[cell_units[0]]
total_cell_value += float(cell_numbers[i]) * convert_to[cell_units[i]]
convert_to = length_conversions[cell_units[0]]
for i in range(len(num_strings)):
num_unit_strings = re.findall('\d+[\./]?[\d+]*', num_strings[i])
total_num_value = 0
for num_unit_string in num_unit_strings:
if "/" in num_unit_string:
total_num_value += float(num_unit_string.split('/')[0])/float(num_unit_string.split('/')[1])
else:
total_num_value += float(num_unit_string)
total_cell_value += total_num_value * convert_to[cell_units[i]]


return str(round(total_cell_value,precision)) + " " + cell_units[0]
Expand Down
12 changes: 12 additions & 0 deletions gldcore/autotest/ceus.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

// generated by csv-ceus2glm-ceus.py
object ceus {
filename "../ceus.csv";
total_real_power "0.0";
total_reactive_power "0.0";
total_power_A "0+0i";
total_power_B "0+0i";
total_power_C "0+0i";
name "building";
floor_area "15000sf";
}
3 changes: 3 additions & 0 deletions gldcore/autotest/config.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#set strictnames=FALSE
#define TEST1=A
#define TEST2=B
10 changes: 10 additions & 0 deletions gldcore/autotest/ica_test.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#define v_per_unit_max_limit="1.05"
#define v_per_unit_min_limit="0.95"
#define change_in_voltage_limit="3"
#define linear_search_step="5000"
#define linear_search_initial="1000"
#define ica_type="1"
#define binary_search_initial="1000"
#define bineary_search_step="500000"
#define bineary_search_tolerance="500"
#define bineary_search_max="15000000"
1 change: 1 addition & 0 deletions gldcore/autotest/modify.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
modify test.var "2.0";
15 changes: 15 additions & 0 deletions gldcore/build.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// /Users/fxie2/github/gridlabd/gldcore/build.h 220110
#define BUILDNUM 220110
#define BRANCH "develop_add_cyme_converter"
#define REV_YEAR 2022
#define BUILD_NAME "origin"
#define BUILD_URL "https://github.com/slacgismo/gridlabd"
#define BUILD_BRANCH "develop-add-cyme-converter"
#define BUILD_SYSTEM "Darwin"
#define BUILD_RELEASE "Darwin 19.6.0"
#define BUILD_ID "073e70afa13e52ed2b85e82a4717694412710708"
#define BUILD_OPTIONS "module/mysql"
#define BUILD_STATUS "## develop-add-cyme-converter...origin/develop-add-cyme-converter [ahead 6]\n"\
"?? dist/\n"\
"?? gridlabd.egg-info/\n"\
""
Loading

0 comments on commit 1cb2048

Please sign in to comment.