diff --git a/CHANGELOG.md b/CHANGELOG.md index c2e58b3c..2161a29a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pyincore/hazardservice.py b/pyincore/hazardservice.py index 17d50373..3687c670 100644 --- a/pyincore/hazardservice.py +++ b/pyincore/hazardservice.py @@ -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() @@ -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() @@ -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() @@ -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) @@ -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) diff --git a/pyincore/spaceservice.py b/pyincore/spaceservice.py index b8d0b4da..7be0dd5a 100644 --- a/pyincore/spaceservice.py +++ b/pyincore/spaceservice.py @@ -38,7 +38,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() @@ -214,7 +214,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)