[DEV-3152] Add EAS Python SDK methods for running opendss export#30
Conversation
|
Task linked: DEV-3152 Add EAS python sdk methods |
493146a to
3fcfba2
Compare
charlta
left a comment
There was a problem hiding this comment.
Very quick once over, so just adding as comments. Will leave to others that can test it to give approval etc.
src/zepben/eas/client/eas_client.py
Outdated
| response = await response.text() | ||
| return response | ||
|
|
||
| def get_paged_opendss_models(self, |
There was a problem hiding this comment.
this is very much a nipick, feel free to ignore:
the format of this signature doesnt match init
ie: init has self on a newline, and all the args are indented only one spacing.
src/zepben/eas/client/eas_client.py
Outdated
| """ | ||
| return get_event_loop().run_until_complete(self.async_get_paged_opendss_models(limit, offset, query_filter, query_sort)) | ||
|
|
||
| async def async_get_paged_opendss_models(self, |
src/zepben/eas/client/eas_client.py
Outdated
| response = await response.text() | ||
| return response | ||
|
|
||
| def get_opendss_model_download_url(self, id: int): |
There was a problem hiding this comment.
nit: id is shadowing a built-in, perhaps run_id?
src/zepben/eas/client/eas_client.py
Outdated
| """ | ||
| return get_event_loop().run_until_complete(self.async_get_opendss_model_download_url(id)) | ||
|
|
||
| async def async_get_opendss_model_download_url(self, id: int): |
There was a problem hiding this comment.
nit: id is shadowing a built-in, perhaps run_id?
src/zepben/eas/client/opendss.py
Outdated
| @@ -0,0 +1,55 @@ | |||
| # Copyright 2020 Zeppelin Bend Pty Ltd | |||
| } | ||
| } | ||
| """ | ||
|
|
| assert actual_body['variables'] == { } | ||
|
|
||
| return Response(json.dumps({"result": "success"}), status=200, content_type="application/json") | ||
|
|
| res = eas_client.get_paged_opendss_models() | ||
| httpserver.check_assertions() | ||
| assert res == {"result": "success"} | ||
|
|
| res = eas_client.get_opendss_model_download_url(1) | ||
| httpserver.check_assertions() | ||
| assert res == "https://example.com/download/1" | ||
|
|
| response = await response.text() | ||
| return response | ||
|
|
||
| def run_opendss_export(self, config: OpenDssConfig): |
There was a problem hiding this comment.
not a job for now and more of an observation then anything, but it almost feels like this file needs to be broken up. at >1000 lines its a little unwieldy - and has, in my opinion, alot of logic related to different components.
There was a problem hiding this comment.
yeah would be nice if this was a client where you could see what it can do 😄
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: clydeu <clyde.uyenghua@zepben.com>
Signed-off-by: Roberto Marquez <roberto.marquez@zepben.com>
f1f4c14 to
2b14e65
Compare
roberto-marquez
left a comment
There was a problem hiding this comment.
We need this for a deployment so it will get merged now. If anyone cares about the additional changes to this PR they can open a ticket in Clickup
Description
Add client methods for running opendss export, listing the runs and getting a download url.
Associated tasks
Test Steps
Explain in detail how your reviewer can test the changes proposed in this PR. If it cannot be tested, leave an explanation on why.
Checklist
If any of these are not applicable, strikethrough the line
~like this~. Do not delete it!. Let the reviewer decide if you should have done it.Code
Documentation
Breaking Changes
No breaking change.