Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dchassin committed Jan 20, 2025
1 parent 4a0e964 commit f8bb5d8
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 7 deletions.
6 changes: 1 addition & 5 deletions runtime/resource.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ resource,protocol,port,hostname,index,content,mimetype,deprecation,comment
localhost,http,6267-6279,127.0.0.1,,,,Server mode support (see https://docs.gridlabd.us/)
buildings,http,80,buildings.gridlabd.us.s3-website-us-west-1.amazonaws.com,/index,/{index},,,Compiled AutoBEM4 building data
code,https,443,raw.githubusercontent.com,/{origin}/refs/heads/{gitbranch}/index,/{origin}/refs/heads/{gitbranch}/{index},Github release code repository
#code-dev,https,443,github.com,,/{organization}/gridlabd/tree/{gitbranch},,,Github development code repository
#develop.code,https,443,develop.code.gridlabd.us
#develop.source,https,443,develop.source.gridlabd.us
#dmg,https,443,dmg.gridlabd.us
#docker,https,443,docker.gridlabd.us
#docker,https,443,hub.docker.com,/v2/repositories/lfenergy/arras/tags/?page_size=1000,/v2/repositories/lfenergy/arras/{index},*/*,,Dockerhub list of repositories
#docs-dev,https,443,docs-dev.gridlabd.us
#docs,https,443,docs.gridlabd.us
elevation,https,443,s3.us-west-1.amazonaws.com,/elevation.gridlabd.us/index,/elevation.gridlabd.us/{index},image/tiff,,Ground elevation data
Expand Down
2 changes: 1 addition & 1 deletion tools/autotest/test_resource.glm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ with open('test_resource.txt','w') as fh:
print(err,file=fh)
#end

#system gridlabd resource --test=buildings >> test_resource.txt
#system gridlabd resource --test=buildings 1>>test_resource.txt 2>&1

#ifexist "../test_resource.txt"
#on_exit 0 diff ../test_resource.txt test_resource.txt > gridlabd.diff
Expand Down
49 changes: 49 additions & 0 deletions tools/autotest/test_resource.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,52 @@
"US/NH_Sullivan.csv.gz",
"US/TN_Hamilton.csv.gz"
]
*** Testing resource 'buildings' ***
Properties:
resource: 'buildings'
protocol: 'http'
port: '80'
hostname: 'buildings.gridlabd.us.s3-website-us-west-1.amazonaws.com'
index: '/index'
content: '/{index}'
mimetype: ''
deprecation: ''
comment: 'Compiled AutoBEM4 building data'
buildings/US/CA_Alameda.csv.gz... 18632521 bytes
buildings/US/CA_Contra_Costa.csv.gz... 15657475 bytes
buildings/US/CA_Los_Angeles.csv.gz... 119942371 bytes
buildings/US/CA_Orange.csv.gz... 35373139 bytes
buildings/US/CA_Riverside.csv.gz... 35813122 bytes
buildings/US/CA_San_Bernardino.csv.gz... 32401374 bytes
buildings/US/CA_San_Diego.csv.gz... 40106258 bytes
buildings/US/CA_San_Francisco.csv.gz... 9616400 bytes
buildings/US/CA_San_Mateo.csv.gz... 9042463 bytes
buildings/US/CA_Santa_Clara.csv.gz... 20501437 bytes
buildings/US/ME_Androscoggin.csv.gz... 2435518 bytes
buildings/US/ME_Aroostook.csv.gz... 2882124 bytes
buildings/US/ME_Cumberland.csv.gz... 6800068 bytes
buildings/US/ME_Franklin.csv.gz... 1261789 bytes
buildings/US/ME_Hancock.csv.gz... 2577025 bytes
buildings/US/ME_Kennebec.csv.gz... 3678406 bytes
buildings/US/ME_Knox.csv.gz... 1606996 bytes
buildings/US/ME_Lincoln.csv.gz... 1634632 bytes
buildings/US/ME_Oxford.csv.gz... 2024315 bytes
buildings/US/ME_Penobscot.csv.gz... 4441180 bytes
buildings/US/ME_Piscataquis.csv.gz... 1030636 bytes
buildings/US/ME_Sagadahoc.csv.gz... 1172538 bytes
buildings/US/ME_Somerset.csv.gz... 2163186 bytes
buildings/US/ME_Waldo.csv.gz... 1635656 bytes
buildings/US/ME_Washington.csv.gz... 1670936 bytes
buildings/US/ME_York.csv.gz... 5920601 bytes
buildings/US/NH_Belknap.csv.gz... 2112766 bytes
buildings/US/NH_Carroll.csv.gz... 2268762 bytes
buildings/US/NH_Cheshire.csv.gz... 1918629 bytes
buildings/US/NH_Coos.csv.gz... 986734 bytes
buildings/US/NH_Grafton.csv.gz... 2107669 bytes
buildings/US/NH_Hillsborough.csv.gz... 6474492 bytes
buildings/US/NH_Merrimack.csv.gz... 3239426 bytes
buildings/US/NH_Rockingham.csv.gz... 6095088 bytes
buildings/US/NH_Strafford.csv.gz... 2249422 bytes
buildings/US/NH_Sullivan.csv.gz... 1206218 bytes
buildings/US/TN_Hamilton.csv.gz... 6563451 bytes
Tested 37 resources (415.2 MB) with 0 failures
5 changes: 4 additions & 1 deletion tools/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def _download(self,
**kwargs):
url = f"{protocol}://{hostname}:{port}{content}"
try:
app.verbose(f"requests.get(url={repr(url)},headers={headers},timeout={self.TIMEOUT})")
req = requests.get(url,headers=headers,timeout=self.TIMEOUT)
req.raise_for_status()
except Exception as err:
Expand All @@ -151,6 +152,7 @@ def _headers(self,
**kwargs):
url = f"{protocol}://{hostname}:{port}{content}"
try:
app.verbose(f"requests.head(url={repr(url)},headers={headers},timeout={self.TIMEOUT})")
req = requests.head(url,headers=headers,timeout=self.TIMEOUT)
req.raise_for_status()
except Exception as err:
Expand Down Expand Up @@ -463,7 +465,8 @@ def test(pattern='.*'):
#

options = []
# options.extend(["--debug"])
options.extend(["--debug"])
options.extend(["--verbose"])
# options.extend(["--format=csv"])
# options.extend(["--format=csv,fmt:.0f"])
# options.extend(["--format=json,indent:4"])
Expand Down

0 comments on commit f8bb5d8

Please sign in to comment.