Skip to content

Conversation

@clydeu
Copy link
Member

@clydeu clydeu commented Jun 4, 2025

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

  • I have performed a self review of my own code (including checking issues raised when creating the PR).
  • I have added/updated unit tests for these changes, and if not I have explained why they are not necessary.
  • I have commented my code in any hard-to-understand or hacky areas.
  • I have handled all new warnings generated by the compiler or IDE.
  • I have rebased onto the target branch (usually main).

Documentation

  • I have updated the changelog.
  • I have updated any documentation required for these changes.

Breaking Changes

  • I have considered if this is a breaking change and will communicate it with other team members by posting it on the Slack breaking-changes channel.

No breaking change.

@ryanjcoleman
Copy link
Member

Task linked: DEV-3152 Add EAS python sdk methods

@clydeu clydeu force-pushed the DEV-3152-Add-EAS-python-sdk-methods-for-opendss-export branch from 493146a to 3fcfba2 Compare June 4, 2025 04:06
@clydeu clydeu marked this pull request as ready for review June 4, 2025 04:53
@clydeu clydeu requested review from a team and zarakay June 4, 2025 04:54
Copy link
Member

@charlta charlta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very quick once over, so just adding as comments. Will leave to others that can test it to give approval etc.

@clydeu clydeu requested a review from chestm007 June 19, 2025 02:04
response = await response.text()
return response

def get_paged_opendss_models(self,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 62c36bc

"""
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: as above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 62c36bc

response = await response.text()
return response

def get_opendss_model_download_url(self, id: int):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: id is shadowing a built-in, perhaps run_id?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 62c36bc

"""
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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: id is shadowing a built-in, perhaps run_id?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 62c36bc

@@ -0,0 +1,55 @@
# Copyright 2020 Zeppelin Bend Pty Ltd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright date, 2025?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops. fixed in 2dfab29

}
}
"""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing blank line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 62c36bc

assert actual_body['variables'] == { }

return Response(json.dumps({"result": "success"}), status=200, content_type="application/json")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing blank line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 62c36bc

res = eas_client.get_paged_opendss_models()
httpserver.check_assertions()
assert res == {"result": "success"}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing blank line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 62c36bc

res = eas_client.get_opendss_model_download_url(1)
httpserver.check_assertions()
assert res == "https://example.com/download/1"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing blank line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 62c36bc

response = await response.text()
return response

def run_opendss_export(self, config: OpenDssConfig):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah would be nice if this was a client where you could see what it can do 😄

@clydeu clydeu requested a review from chestm007 June 19, 2025 05:44
@roberto-marquez roberto-marquez force-pushed the DEV-3152-Add-EAS-python-sdk-methods-for-opendss-export branch from f1f4c14 to 2b14e65 Compare June 24, 2025 02:08
@roberto-marquez roberto-marquez self-requested a review June 24, 2025 02:08
Copy link
Member

@roberto-marquez roberto-marquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@roberto-marquez roberto-marquez merged commit 06c5947 into main Jun 24, 2025
5 checks passed
@roberto-marquez roberto-marquez deleted the DEV-3152-Add-EAS-python-sdk-methods-for-opendss-export branch June 24, 2025 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants