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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Fixed Sphinx autodoc skipping class methods with custom decorators. [#518](https://github.com/IN-CORE/pyincore/issues/518)
- Pyomo version fixed to fix indp solver failure [#585](https://github.com/IN-CORE/pyincore/issues/585)
- Uploaded raster files doesn't respect the order [#614](https://github.com/IN-CORE/pyincore/issues/614)

### Changed
- Support Interdependent recovery of residential buildings and households [#606](https://github.com/IN-CORE/pyincore/pull/606)
Expand Down
20 changes: 10 additions & 10 deletions pyincore/hazardservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ def create_earthquake(

"""
url = self.base_earthquake_url
eq_data = {("earthquake", eq_json)}
eq_data = [("earthquake", eq_json)]

for file_path in file_paths:
eq_data.add(("file", open(file_path, "rb")))
eq_data.append(("file", open(file_path, "rb")))
kwargs = {"files": eq_data}
r = self.client.post(url, timeout=timeout, **kwargs)
return return_http_response(r).json()
Expand Down Expand Up @@ -558,10 +558,10 @@ def create_tornado_scenario(

"""
url = self.base_tornado_url
tornado_data = {("tornado", tornado_json)}
tornado_data = [("tornado", tornado_json)]

for file_path in file_paths:
tornado_data.add(("file", open(file_path, "rb")))
tornado_data.append(("file", open(file_path, "rb")))
kwargs = {"files": tornado_data}
r = self.client.post(url, timeout=timeout, **kwargs)
return return_http_response(r).json()
Expand Down Expand Up @@ -708,10 +708,10 @@ def create_tsunami_hazard(
"""

url = self.base_tsunami_url
tsunami_data = {("tsunami", tsunami_json)}
tsunami_data = [("tsunami", tsunami_json)]

for file_path in file_paths:
tsunami_data.add(("file", open(file_path, "rb")))
tsunami_data.append(("file", open(file_path, "rb")))
kwargs = {"files": tsunami_data}
r = self.client.post(url, timeout=timeout, **kwargs)
return return_http_response(r).json()
Expand Down Expand Up @@ -783,10 +783,10 @@ def create_hurricane(

"""
url = self.base_hurricane_url
hurricane_data = {("hurricane", hurricane_json)}
hurricane_data = [("hurricane", hurricane_json)]

for file_path in file_paths:
hurricane_data.add(("file", open(file_path, "rb")))
hurricane_data.append(("file", open(file_path, "rb")))
kwargs = {"files": hurricane_data}
r = self.client.post(url, timeout=timeout, **kwargs)

Expand Down Expand Up @@ -926,10 +926,10 @@ def create_flood(self, flood_json, file_paths: List, timeout=(30, 600), **kwargs

"""
url = self.base_flood_url
flood_data = {("flood", flood_json)}
flood_data = [("flood", flood_json)]

for file_path in file_paths:
flood_data.add(("file", open(file_path, "rb")))
flood_data.append(("file", open(file_path, "rb")))
kwargs = {"files": flood_data}
r = self.client.post(url, timeout=timeout, **kwargs)

Expand Down
4 changes: 2 additions & 2 deletions pyincore/spaceservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def create_space(self, space_json, timeout=(30, 600), **kwargs):

"""
url = self.base_space_url
space_data = {("space", space_json)}
space_data = [("space", space_json)]
kwargs["files"] = space_data
r = self.client.post(url, timeout=timeout, **kwargs)
return return_http_response(r).json()
Expand Down Expand Up @@ -215,7 +215,7 @@ def grant_privileges_to_space(

"""
url = urljoin(self.base_space_url, space_id + "/grant")
space_privileges = {("grant", privileges_json)}
space_privileges = [("grant", privileges_json)]
kwargs["files"] = space_privileges
r = self.client.post(url, timeout=timeout, **kwargs)

Expand Down
Loading