Skip to content

Commit

Permalink
24 pypi library (#25)
Browse files Browse the repository at this point in the history
* Add release workflow for develop

* Add license and copyright

* Add virtualenv setting to poetry.toml
Updated authors and dependencies for project.

* Fix syntax issues with readme.

* Update author list

* Updated gitignore file

* remove .lock file

* Removed pytest cache file
  • Loading branch information
craig8 authored Jun 1, 2023
1 parent 8f41206 commit e727718
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 367 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy-dev-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Deploy Pre-Release Artifacts

on:
push:
branches:
- develop
workflow_dispatch:

defaults:
run:
shell: bash

env:
LANG: en_US.utf-8
LC_ALL: en_US.utf-8
PYTHON_VERSION: '3.10'

jobs:
call-deploy-release:
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch

uses: GRIDAPPSD/.github/.github/workflows/deploy-dev-release.yml@main
secrets:
git-token: ${{ secrets.GITHUB_TOKEN }}
pypi-token: ${{ secrets.PYPI_TOKEN }}

145 changes: 106 additions & 39 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,41 +1,108 @@
*.ipynb_checkpoints/
.*.sw?
*.py[co]
*.egg-info
*~
.svn
.metadata
parser.out
node_modules
applications
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
.pytest_cache/
# C extensions
*.so

# Distribution / packaging
.Python
poetry.lock
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.idea
/env/
.venv/
/Agents/*/{build,dist}/
/Agents/*.egg
/.project
/.pydevproject
/twistd.pid
/.settings
/build
/configs/
/config/
/docs/build/*
/docs/source/volttron-api
volttron.log
__pycache__
.vscode/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version
.pytest_cache
start-rabbitmq
stop-rabbitmq
rabbitmq.log
*.result.txt
.coverage
htmlcov/
MnesiaCore.*
rabbitmq-server.download.tar.xz
/MagicMock/mock/
/docs/source/volttron_api/
/dist/

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# idea project
.idea/

# visual studio code
.vscode/
22 changes: 22 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright 2023, Battelle Memorial Institute. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Copyright 2023 Battelle Memorial Institute

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To subscribe to the service create a class or function definition that is then p

A working example is available in the `topo_service_tester.py` script, which subscribes to the topology service of a running simulation and then prints feeder and island info to the terminal window as switching actions are made.

```
```python
output_topic = "/topic/goss.gridappsd.simulation.topologyprocessor."+str(viz_simulation_id)+".output"

def DemoTPsubscriber(headers, message):
Expand All @@ -64,9 +64,9 @@ There are three API calls that can be made.

### GET_BASE_TOPOLOGY

This API call generates the full topology dictionary for the feeder using the normally-open / normally-closed switch positions in the CIM XML feeder model.
This API call generates the full topology dictionary for the feeder using the normally-open / normally-closed switch positions in the CIM XML feeder model.

```
```python
topic = "goss.gridappsd.request.data.topology"

message = {
Expand All @@ -80,7 +80,7 @@ message = gapps.get_response(topic, message, timeout=30)

It returns a Python dictionary / JSON string message in the following format:

```
```python
{
"feeder_id": "_49AD8E07-3BF9-A4E2-CB8F-C3722F837B62",
"feeders": {
Expand Down Expand Up @@ -309,9 +309,7 @@ It returns a Python dictionary / JSON string message in the following format:

### GET_SNAPSHOT_TOPOLOGY



```
```python
topic = "goss.gridappsd.request.data.topology"

message = {
Expand All @@ -330,7 +328,7 @@ message = gapps.get_response(topic, message, timeout=90)

This call returns the dictionary of feeder equipment used by the GridAPPS-D Distributed API.

```
```python
topic = "goss.gridappsd.request.data.topology"

message = {
Expand Down
Loading

0 comments on commit e727718

Please sign in to comment.