From f7e3f77705cb95dc65027d9fe172f7f9a5783c5f Mon Sep 17 00:00:00 2001 From: Latif Date: Fri, 22 Mar 2024 15:50:45 -0600 Subject: [PATCH] adsf --- Dockerfile | 2 +- README.md | 4 ++-- docs/Makefile | 4 ++-- docs/README.md | 2 +- docs/source/Co-simulation Interfaces.rst | 6 +++--- docs/source/conf.py | 6 +++--- docs/source/hdf-data-format.rst | 4 ++-- docs/source/index.rst | 10 +++++----- docs/source/reports.rst | 2 +- docs/source/spec/swagger.json | 2 +- docs/source/spec/swagger.yml | 6 +++--- docs/source/tutorial.rst | 2 +- src/pydss/api/schema/PyDSS.v1.json | 6 +++--- src/pydss/api/src/web/handler.py | 6 +++--- src/pydss/pyPostprocessor/pyPostprocess.py | 2 +- src/pydss/registry.py | 6 +++--- src/pydss/reports/reports.py | 4 ++-- tests/test_custom_exports.py | 2 +- 18 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2666c64b..93a9d54c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN pip install --upgrade pip # Install the python modules RUN pip install -e . -ENV PYTHONPATH=/PyDSS/PyDSS +ENV PYTHONPATH=/pydss/PyDSS EXPOSE 5000/tcp EXPOSE 9090/tcp diff --git a/README.md b/README.md index d8c26f9b..c4d2e49f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Welcome to the pydss Repository! -**PyDSS** is a high level python interface for **OpenDSS** and provides the following functionalities +**Pydss** is a high level python interface for **OpenDSS** and provides the following functionalities -Documentation on installation, setup and examples can be found here https://nrel.github.io/PyDSS/index.html +Documentation on installation, setup and examples can be found here https://nrel.github.io/pydss/index.html diff --git a/docs/Makefile b/docs/Makefile index 30dcdf24..3112b3d8 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -29,8 +29,8 @@ model_tables: python make_model_tables.py -o $(BUILDDIR)/model_tables github: html - rm -rf source/PyDSS - sphinx-apidoc -o source/PyDSS ../PyDSS + rm -rf source/pydss + sphinx-apidoc -o source/pydss ../pydss -git branch -D gh-pages -git push origin --delete gh-pages ghp-import -n -b gh-pages -m "Update documentation" ./build/html diff --git a/docs/README.md b/docs/README.md index ad6577e0..dc50e3f4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,7 +15,7 @@ pip install sphinx sphinx-rtd-theme From docs directory: ``` -sphinx-apidoc -o source/PyDSS ../PyDSS +sphinx-apidoc -o source/pydss ../pydss ``` ## Build HTML Docs diff --git a/docs/source/Co-simulation Interfaces.rst b/docs/source/Co-simulation Interfaces.rst index bacdb2a6..bd174ec9 100644 --- a/docs/source/Co-simulation Interfaces.rst +++ b/docs/source/Co-simulation Interfaces.rst @@ -28,7 +28,7 @@ Following attributes can be configured for the HELICS interface. Default values for additional simulation settings are as follows. For more information on how to appropriately set these values please look at HELICS documentaion Once the HELICS co-simulation interface has been enabled, the next step is to set up ``publications`` and ``subscriptions`` to set up information exchange with external federates. -PyDSS enables zero code setup of these modules. Each scenario can have its publlcation and subscription defination and is managed by two file in the ``ExportLists`` directory for a given scenario. +Pydss enables zero code setup of these modules. Each scenario can have its publlcation and subscription defination and is managed by two file in the ``ExportLists`` directory for a given scenario. publication tags (names) follow the following convertion @@ -133,8 +133,8 @@ the same controller can be implemented as a pyController object in pydss. The socket interface in pydss also come in handy, when setting up a hardware-in-loop type simulations and integrating the simulation engine with actual hardware. Interfaces similar to raw socket implementations have been developed (to be open-sourced at a later time) for Modbus-TCP and DNP3 communcations have developed and tested with pydss with sucess. A minimal socket interfacing example has -been provided as a pydss project in ~PyDSS/examples/external_interfaces. Within the folder, -~/PyDSS/examples/external_interfaces/pydss_project a scenario called 'socket' has been defined. Socket +been provided as a pydss project in ~pydss/examples/external_interfaces. Within the folder, +~/pydss/examples/external_interfaces/pydss_project a scenario called 'socket' has been defined. Socket controller definations have been detailed with the 'pyControllerList' folder. An example of input requirements can be studied below. This example will publish ``voltage magnitude`` (see Even set in Index) and ``real power`` for load ``Load.mpx000635970`` in the model. Subscribed values will be used to update the ``kW`` property of the coupled load (Load.mpx000635970 in this case) diff --git a/docs/source/conf.py b/docs/source/conf.py index 4caf6183..29248040 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -43,12 +43,12 @@ def find_version(*file_paths): return version_match.group(1) raise RuntimeError("Unable to find version string.") -project = 'PyDSS' +project = 'pydss' copyright = '2019, Aadil Latif' author = 'Aadil Latif' # The full version, including alpha/beta/rc tags -release = find_version("../../PyDSS", "__init__.py") +release = find_version("../../pydss", "__init__.py") # -- General configuration --------------------------------------------------- @@ -98,7 +98,7 @@ def find_version(*file_paths): redoc = [ { - 'name': 'PyDSS API', + 'name': 'pydss API', 'page': 'api', 'spec': 'spec/swagger.yml', 'embed': True, diff --git a/docs/source/hdf-data-format.rst b/docs/source/hdf-data-format.rst index 975efa75..6a94eb8a 100755 --- a/docs/source/hdf-data-format.rst +++ b/docs/source/hdf-data-format.rst @@ -45,7 +45,7 @@ the data then a suffix is added to the property name. Common Metadata =============== -PyDSS stores metadata that is common to all datasets in the root of the +Pydss stores metadata that is common to all datasets in the root of the scenario group. For example, the ``Timestamp`` dataset contains the simulation timestamps (seconds since epoch) for all datasets that store values at every time point. :: @@ -56,7 +56,7 @@ time point. :: Dataset Metadata ================ -PyDSS stores metadata for each dataset in HDF attributes as well as other +Pydss stores metadata for each dataset in HDF attributes as well as other datasets. This metadata describes the contents of datasets. Attributes per dataset diff --git a/docs/source/index.rst b/docs/source/index.rst index 5992d432..3da794d0 100755 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -11,10 +11,10 @@ PyDSS ##### *********** -About PyDSS +About Pydss *********** -PyDSS is a Python wrapper for OpenDSS that aims to expand upon its +Pydss is a Python wrapper for OpenDSS that aims to expand upon its organizational, analytical, and visualization capabilities with these features: - Allows the user to develop custom control algorithms for specific circuit elements and run them @@ -25,7 +25,7 @@ organizational, analytical, and visualization capabilities with these features: - Automates collection and analysis of circuit element results at each simulation time step. - Flexible architecture allows users to develop extensions. -PyDSS uses opendssdirect.py (https://pypi.org/project/OpenDSSDirect.py/) to communicate with +Pydss uses opendssdirect.py (https://pypi.org/project/OpenDSSDirect.py/) to communicate with OpenDSS. .. _installation_label: @@ -61,7 +61,7 @@ Alternatively, to get the lastest code from the master branch: .. code-block:: bash $ git clone https://github.com/NREL/PyDSS - $ pip install -e PyDSS + $ pip install -e NREL-pydss Confirm the installation with this command. It should print the available commands:: @@ -69,7 +69,7 @@ Confirm the installation with this command. It should print the available comman ************* -Running PyDSS +Running Pydss ************* Refer to the :ref:`quick_start_label` for basic instructions on how to configure pydss to run a simulation with an existing OpenDSS model. diff --git a/docs/source/reports.rst b/docs/source/reports.rst index 80125d74..5ed2b746 100755 --- a/docs/source/reports.rst +++ b/docs/source/reports.rst @@ -76,7 +76,7 @@ Adding New Reports ****************** Here's how to create a new report in pydss. -#. Create a new class in a Python file in ``PyDSS/reports``. The class must +#. Create a new class in a Python file in ``pydss/reports``. The class must inherit from ``ReportBase``. #. Implement the required methods: diff --git a/docs/source/spec/swagger.json b/docs/source/spec/swagger.json index 845d9f17..8a9d203d 100644 --- a/docs/source/spec/swagger.json +++ b/docs/source/spec/swagger.json @@ -1 +1 @@ -{"openapi": "3.0.0", "info": {"title": "PyDSS RESTful API documentation", "version": "3.0.2", "description": "The API enables creating pydss instances, running simulations and creation of new projects."}, "paths": {"/simulators/pydss/instances": {"head": {"summary": "Returns UUIDs of all the instances currently running on the server", "tags": ["simulation status"], "responses": {"200": {"description": "UUIDs of all currently running pydss instances have been returned", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "2 pydss instances currently running", "UUID": []}}}}}}, "204": {"description": "No active pydss instance found", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 204, "Message": "No pydss instance currently running", "UUID": ["96c21e00-cd3c-4943-a914-14451f5f7ab6", "96c21e045-cd6c-8394-a914-14451f5f7ab6"]}}}}}}}}, "get": {"summary": "Returns UUIDs of all the instances currently running on the server", "tags": ["simulation status"], "responses": {"200": {"description": "UUIDs of all currently running pydss instances have been returned", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "2 pydss instances currently running", "UUID": []}}}}}}, "204": {"description": "No active pydss instance found", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 204, "Message": "No pydss instance currently running", "UUID": ["96c21e00-cd3c-4943-a914-14451f5f7ab6", "96c21e045-cd6c-8394-a914-14451f5f7ab6"]}}}}}}}}}, "/simulators/pydss/status/uuid/{uuid}": {"head": {"summary": "Returns states of process of with UUID matching the passed UUID", "tags": ["simulation status"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "example": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}, "style": "simple", "explode": false}], "responses": {"200": {"description": "PyDSS instance with the provided UUID is currently running", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS instance with the provided UUID is currently running", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "204": {"description": "PyDSS instance with the provided UUID does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 204, "Message": "PyDSS instance with the provided UUID does not exist", "UUID": "None"}}}}}}}}, "get": {"summary": "Returns states of process of with UUID matching the passed UUID", "tags": ["simulation status"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "example": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}, "style": "simple", "explode": false}], "responses": {"200": {"description": "PyDSS instance with the provided UUID is currently running", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS instance with the provided UUID is currently running", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "204": {"description": "PyDSS instance with the provided UUID does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 204, "Message": "PyDSS instance with the provided UUID does not exist", "UUID": "None"}}}}}}}}}, "/simulators/pydss/info": {"head": {"summary": "Returns a dictionary of valid project and scenarios in the provided path", "tags": ["PyDSS project"], "parameters": [{"name": "path", "in": "query", "required": true, "schema": {"type": "string", "example": "C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples"}, "style": "form", "explode": true}], "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS instance with the provided UUID is currently running", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6", "Data": {"Project1": {"Scenario1": null, "Scenario2": null}, "Project2": {"Scenario1": null}}}}}}}}, "406": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 406, "Message": "Provided path does not exist", "UUID": "None"}}}}}}}}, "get": {"summary": "Returns a dictionary of valid project and scenarios in the provided path", "tags": ["PyDSS project"], "parameters": [{"name": "path", "in": "query", "required": true, "schema": {"type": "string", "example": "C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples"}, "style": "form", "explode": true}], "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS instance with the provided UUID is currently running", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6", "Data": {"Project1": {"Scenario1": null, "Scenario2": null}, "Project2": {"Scenario1": null}}}}}}}}, "406": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 406, "Message": "Provided path does not exist", "UUID": "None"}}}}}}}}}, "/simulators/pydss": {"put": {"summary": "Run a command on an active instance of PyDSS", "tags": ["Simulation"], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"uuid": {"type": "string", "format": "UUID", "example": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}, "command": {"type": "string", "example": "initialize"}, "parameters": {"type": "object"}}}, "examples": {"Example_1": {"value": {"UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6", "command": "run", "parameters": {}}}}}}, "required": false}, "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "Command submitted, awaiting response", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "401": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 401, "Message": "Please provide a command and parameters", "UUID": "None"}}}}}}, "403": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 403, "Message": "Provided UUID is not valid pydss instance id", "UUID": "None"}}}}}}}}, "post": {"summary": "Creates an instance of pydss and runs the simulation", "tags": ["Simulation"], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"parameters": {"type": "object"}}}, "examples": {"Example 1": {"value": {"parameters": {"Start Year": 2017, "Start Day": 1, "Start Time (min)": 0, "End Day": 1, "End Time (min)": 1439, "Date offset": 0, "Step resolution (sec)": 900, "Max Control Iterations": 50, "Error tolerance": 0.001, "Control mode": "Static", "Simulation Type": "QSTS", "Project Path": "C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples", "Active Project": "custom_contols", "Active Scenario": "base_case", "DSS File": "Master_Spohn_existing_VV.dss", "Co-simulation Mode": false, "Log Results": false, "Export Data Tables": true, "Export Data In Memory": true, "Federate name": "PyDSS_x"}}}}}}, "required": false}, "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "Starting a pydss instance", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "500": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 500, "Message": "Failed to create a pydss instance", "UUID": "None"}}}}}}}}, "delete": {"summary": "Deletes an active instance of PyDSS", "tags": ["Simulation"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "example": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}, "style": "simple", "explode": false}], "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "Successfully deleted a pydss instance", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "403": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 403, "Message": "Error closing pydss instance", "UUID": "None"}}}}}}}}}, "/simulators/pydss/create": {"post": {"summary": "Creates a new project for pydss (User uploads a zipped OpenDSS model)", "tags": ["PyDSS project"], "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "properties": {"master_file": {"type": "string", "example": "Master_Spohn_existing_VV.dss"}, "project": {"type": "string", "example": "test_project"}, "scenarios": {"type": "string", "description": "comma separated list of pydss scenarios to be created", "example": "base_case,pv_scenario"}, "controller_types": {"type": "string", "description": "comma separated list of pydss controller names", "example": "PvController,StorageController"}, "visualization_types": {"type": "string", "description": "comma separated list of pydss plot names", "example": "Histogram,TimeSeries"}, "fileName": {"type": "string", "format": "binary"}}}}}, "required": false}, "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS project created", "UUID": "None"}}}}}}, "403": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 403, "Message": "User does not have access to delete folders", "UUID": "None"}}}}}}}}}}} \ No newline at end of file +{"openapi": "3.0.0", "info": {"title": "PyDSS RESTful API documentation", "version": "3.0.2", "description": "The API enables creating pydss instances, running simulations and creation of new projects."}, "paths": {"/simulators/pydss/instances": {"head": {"summary": "Returns UUIDs of all the instances currently running on the server", "tags": ["simulation status"], "responses": {"200": {"description": "UUIDs of all currently running pydss instances have been returned", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "2 pydss instances currently running", "UUID": []}}}}}}, "204": {"description": "No active pydss instance found", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 204, "Message": "No pydss instance currently running", "UUID": ["96c21e00-cd3c-4943-a914-14451f5f7ab6", "96c21e045-cd6c-8394-a914-14451f5f7ab6"]}}}}}}}}, "get": {"summary": "Returns UUIDs of all the instances currently running on the server", "tags": ["simulation status"], "responses": {"200": {"description": "UUIDs of all currently running pydss instances have been returned", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "2 pydss instances currently running", "UUID": []}}}}}}, "204": {"description": "No active pydss instance found", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 204, "Message": "No pydss instance currently running", "UUID": ["96c21e00-cd3c-4943-a914-14451f5f7ab6", "96c21e045-cd6c-8394-a914-14451f5f7ab6"]}}}}}}}}}, "/simulators/pydss/status/uuid/{uuid}": {"head": {"summary": "Returns states of process of with UUID matching the passed UUID", "tags": ["simulation status"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "example": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}, "style": "simple", "explode": false}], "responses": {"200": {"description": "PyDSS instance with the provided UUID is currently running", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS instance with the provided UUID is currently running", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "204": {"description": "PyDSS instance with the provided UUID does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 204, "Message": "PyDSS instance with the provided UUID does not exist", "UUID": "None"}}}}}}}}, "get": {"summary": "Returns states of process of with UUID matching the passed UUID", "tags": ["simulation status"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "example": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}, "style": "simple", "explode": false}], "responses": {"200": {"description": "PyDSS instance with the provided UUID is currently running", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS instance with the provided UUID is currently running", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "204": {"description": "PyDSS instance with the provided UUID does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 204, "Message": "PyDSS instance with the provided UUID does not exist", "UUID": "None"}}}}}}}}}, "/simulators/pydss/info": {"head": {"summary": "Returns a dictionary of valid project and scenarios in the provided path", "tags": ["PyDSS project"], "parameters": [{"name": "path", "in": "query", "required": true, "schema": {"type": "string", "example": "C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples"}, "style": "form", "explode": true}], "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS instance with the provided UUID is currently running", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6", "Data": {"Project1": {"Scenario1": null, "Scenario2": null}, "Project2": {"Scenario1": null}}}}}}}}, "406": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 406, "Message": "Provided path does not exist", "UUID": "None"}}}}}}}}, "get": {"summary": "Returns a dictionary of valid project and scenarios in the provided path", "tags": ["PyDSS project"], "parameters": [{"name": "path", "in": "query", "required": true, "schema": {"type": "string", "example": "C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples"}, "style": "form", "explode": true}], "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS instance with the provided UUID is currently running", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6", "Data": {"Project1": {"Scenario1": null, "Scenario2": null}, "Project2": {"Scenario1": null}}}}}}}}, "406": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 406, "Message": "Provided path does not exist", "UUID": "None"}}}}}}}}}, "/simulators/pydss": {"put": {"summary": "Run a command on an active instance of PyDSS", "tags": ["Simulation"], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"uuid": {"type": "string", "format": "UUID", "example": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}, "command": {"type": "string", "example": "initialize"}, "parameters": {"type": "object"}}}, "examples": {"Example_1": {"value": {"UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6", "command": "run", "parameters": {}}}}}}, "required": false}, "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "Command submitted, awaiting response", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "401": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 401, "Message": "Please provide a command and parameters", "UUID": "None"}}}}}}, "403": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 403, "Message": "Provided UUID is not valid pydss instance id", "UUID": "None"}}}}}}}}, "post": {"summary": "Creates an instance of pydss and runs the simulation", "tags": ["Simulation"], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"parameters": {"type": "object"}}}, "examples": {"Example 1": {"value": {"parameters": {"Start Year": 2017, "Start Day": 1, "Start Time (min)": 0, "End Day": 1, "End Time (min)": 1439, "Date offset": 0, "Step resolution (sec)": 900, "Max Control Iterations": 50, "Error tolerance": 0.001, "Control mode": "Static", "Simulation Type": "QSTS", "Project Path": "C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples", "Active Project": "custom_contols", "Active Scenario": "base_case", "DSS File": "Master_Spohn_existing_VV.dss", "Co-simulation Mode": false, "Log Results": false, "Export Data Tables": true, "Export Data In Memory": true, "Federate name": "PyDSS_x"}}}}}}, "required": false}, "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "Starting a pydss instance", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "500": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 500, "Message": "Failed to create a pydss instance", "UUID": "None"}}}}}}}}, "delete": {"summary": "Deletes an active instance of PyDSS", "tags": ["Simulation"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "example": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}, "style": "simple", "explode": false}], "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "Successfully deleted a pydss instance", "UUID": "96c21e00-cd3c-4943-a914-14451f5f7ab6"}}}}}}, "403": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 403, "Message": "Error closing pydss instance", "UUID": "None"}}}}}}}}}, "/simulators/pydss/create": {"post": {"summary": "Creates a new project for pydss (User uploads a zipped OpenDSS model)", "tags": ["PyDSS project"], "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "properties": {"master_file": {"type": "string", "example": "Master_Spohn_existing_VV.dss"}, "project": {"type": "string", "example": "test_project"}, "scenarios": {"type": "string", "description": "comma separated list of pydss scenarios to be created", "example": "base_case,pv_scenario"}, "controller_types": {"type": "string", "description": "comma separated list of pydss controller names", "example": "PvController,StorageController"}, "visualization_types": {"type": "string", "description": "comma separated list of pydss plot names", "example": "Histogram,TimeSeries"}, "fileName": {"type": "string", "format": "binary"}}}}}, "required": false}, "responses": {"200": {"description": "Successfully retrieved project information", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 200, "Message": "PyDSS project created", "UUID": "None"}}}}}}, "403": {"description": "Provided path does not exist", "content": {"application/json": {"schema": {"type": "object"}, "examples": {"get_instance_status": {"value": {"Status": 403, "Message": "User does not have access to delete folders", "UUID": "None"}}}}}}}}}}} \ No newline at end of file diff --git a/docs/source/spec/swagger.yml b/docs/source/spec/swagger.yml index a80ddc01..c358c743 100644 --- a/docs/source/spec/swagger.yml +++ b/docs/source/spec/swagger.yml @@ -160,7 +160,7 @@ paths: required: true schema: type: string - example: C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples + example: C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples style: form explode: true responses: @@ -205,7 +205,7 @@ paths: required: true schema: type: string - example: C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples + example: C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples style: form explode: true responses: @@ -330,7 +330,7 @@ paths: Error tolerance: 0.001 Control mode: Static Simulation Type: QSTS - Project Path: C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples + Project Path: C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples Active Project: custom_contols Active Scenario: base_case DSS File: Master_Spohn_existing_VV.dss diff --git a/docs/source/tutorial.rst b/docs/source/tutorial.rst index 61959534..0e5b7063 100755 --- a/docs/source/tutorial.rst +++ b/docs/source/tutorial.rst @@ -69,7 +69,7 @@ set in each scenario's ``Exports.toml`` on a per-property basis. ``Line.LoadingPercent`` is an example. In this case pydss will read multiple values for a line, compute a loading percentage, and store that. The ``limits`` field can be applied to these values. Refer to - ``CUSTOM_FUNCTIONS`` in ``PyDSS/export_list_reader.py`` to see the options + ``CUSTOM_FUNCTIONS`` in ``pydss/export_list_reader.py`` to see the options available. - Set ``sum_group_file = file_path`` where file_path is a JSON or TOML file relative to the directory from which you will run pydss. The contents of the diff --git a/src/pydss/api/schema/PyDSS.v1.json b/src/pydss/api/schema/PyDSS.v1.json index 6e90ea1b..6753ca98 100644 --- a/src/pydss/api/schema/PyDSS.v1.json +++ b/src/pydss/api/schema/PyDSS.v1.json @@ -89,7 +89,7 @@ "Federate name": "PyDSS_x", "Log Results": false, "Max Control Iterations": 50, - "Project Path": "C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples", + "Project Path": "C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples", "Simulation Type": "QSTS", "Start Day": 1, "Start Time (min)": 0, @@ -347,7 +347,7 @@ "name": "path", "required": true, "schema": { - "example": "C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples", + "example": "C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples", "type": "string" }, "style": "form" @@ -415,7 +415,7 @@ "name": "path", "required": true, "schema": { - "example": "C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples", + "example": "C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples", "type": "string" }, "style": "form" diff --git a/src/pydss/api/src/web/handler.py b/src/pydss/api/src/web/handler.py index ce59a194..34240c48 100644 --- a/src/pydss/api/src/web/handler.py +++ b/src/pydss/api/src/web/handler.py @@ -42,7 +42,7 @@ async def get_pydss_project_info(self, request, path): required: true schema: type: string - example: C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples + example: C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples responses: '200': description: Successfully retrieved project information @@ -156,7 +156,7 @@ async def post_pydss_create(self, request): """ from zipfile import ZipFile - examples_path = os.path.join("C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/", 'examples') + examples_path = os.path.join("C:/Users/alatif/Desktop/PyDSS_2.0/pydss/", 'examples') unzip_path = os.path.join(examples_path, "uploaded_opendss_project") zip_path = os.path.join(examples_path, "uploaded_opendss_project.zip") @@ -246,7 +246,7 @@ async def post_pydss(self, request): Error tolerance: 0.001 Control mode: Static Simulation Type: QSTS - Project Path: "C:/Users/alatif/Desktop/PyDSS_2.0/PyDSS/examples" + Project Path: "C:/Users/alatif/Desktop/PyDSS_2.0/pydss/examples" Active Project: custom_contols Active Scenario: base_case DSS File: Master_Spohn_existing_VV.dss diff --git a/src/pydss/pyPostprocessor/pyPostprocess.py b/src/pydss/pyPostprocessor/pyPostprocess.py index 36904d36..8f320ce5 100644 --- a/src/pydss/pyPostprocessor/pyPostprocess.py +++ b/src/pydss/pyPostprocessor/pyPostprocess.py @@ -20,7 +20,7 @@ def Create(project, scenario, ppInfo, dssInstance, dssSolver, dssObjects, dssObj ScriptName = ppInfo.script assert (ScriptName in pythonFiles), \ f"Definition for '{ScriptName}' post process script not found. \n" \ - "Please define the controller in PyDSS/pyPostprocessor/PostprocessScripts" + "Please define the controller in pydss/pyPostprocessor/PostprocessScripts" PostProcessor = POST_PROCESSES[ScriptName]( project, scenario, diff --git a/src/pydss/registry.py b/src/pydss/registry.py index 4e5caedd..e1d2522d 100644 --- a/src/pydss/registry.py +++ b/src/pydss/registry.py @@ -21,21 +21,21 @@ "name": "NO_VRT", "filename": os.path.join( os.path.dirname(getattr(pydss, "__path__")[0]), - "PyDSS/pyControllers/Controllers/Settings/PvControllers.toml" + "pydss/pyControllers/Controllers/Settings/PvControllers.toml" ), }, { "name": "cpf", "filename": os.path.join( os.path.dirname(getattr(pydss, "__path__")[0]), - "PyDSS/pyControllers/Controllers/Settings/PvControllers.toml" + "pydss/pyControllers/Controllers/Settings/PvControllers.toml" ), }, { "name": "volt-var", "filename": os.path.join( os.path.dirname(getattr(pydss, "__path__")[0]), - "PyDSS/pyControllers/Controllers/Settings/PvControllers.toml" + "pydss/pyControllers/Controllers/Settings/PvControllers.toml" ), }, ], diff --git a/src/pydss/reports/reports.py b/src/pydss/reports/reports.py index f42be673..b63e86bb 100644 --- a/src/pydss/reports/reports.py +++ b/src/pydss/reports/reports.py @@ -142,9 +142,9 @@ def generate(self): return filenames -# Note to devs: all subclasses of ReportBase need to reside in PyDSS/reports +# Note to devs: all subclasses of ReportBase need to reside in pydss/reports # in order to be automatically imported. Otherwise, add a direct import in -# PyDSS/reports/__init__.py. +# pydss/reports/__init__.py. class ReportBase(abc.ABC): """Base class for reports""" diff --git a/tests/test_custom_exports.py b/tests/test_custom_exports.py index 35095ba1..ae23bf0f 100644 --- a/tests/test_custom_exports.py +++ b/tests/test_custom_exports.py @@ -65,7 +65,7 @@ def test_custom_exports(cleanup_project): assert "CurrentsMagAng" not in properties # TODO: This metric no longer stores voltages in a dataframe. - # That functionality could be recovered in PyDSS/metrics.py or we could implement this with + # That functionality could be recovered in pydss/metrics.py or we could implement this with # a different export property. #node_names = scenario.list_element_names("Nodes", "VoltageMetric") #dfs = scenario.get_filtered_dataframes("Nodes", "VoltageMetric")