Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
contains(github.event.pull_request.labels.*.name, 'bug')
with:
project: 'https://github.com/orgs/GRIDAPPSD/projects/7'
column_name: 'Labeled'
column_name: 'Labeled'
1 change: 0 additions & 1 deletion .github/workflows/deploy-dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,3 @@ jobs:
cd ../gridappsd-field-bus-lib
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish

20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
type: bool
release-version:
description: "Version number to use for this release, do not start with v."
required: true
required: true
type: bool
publish-to:
description: "Publish to pypi or pypi-test"
Expand All @@ -19,7 +19,7 @@ on:
options:
- "pypi"
- "pypi-test"

defaults:
run:
shell: bash
Expand Down Expand Up @@ -117,12 +117,12 @@ jobs:
# This is needed, because the poetry publish will fail at the top level of the project
# so ./scripts/run_on_each.sh fails for that.
echo "POETRY_PUBLISH_OPTIONS=''" >> $GITHUB_ENV
cd gridappsd-python-lib
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
cd gridappsd-python-lib
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish

cd ../gridappsd-field-bus-lib
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish

- name: Publish to pypi test
Expand All @@ -132,16 +132,16 @@ jobs:
set -x
set -u
set -e

./scripts/run_on_each.sh poetry config repositories.testpypi https://test.pypi.org/legacy/

# This is needed, because the poetry publish will fail at the top level of the project
# so ./scripts/run_on_each.sh fails for that.
echo "POETRY_PUBLISH_OPTIONS='--repository testpypi'" >> $GITHUB_ENV
cd gridappsd-python-lib
poetry config pypi-token.testpypi ${{ secrets.PYPI_TEST_TOKEN }}
cd gridappsd-python-lib
poetry config pypi-token.testpypi ${{ secrets.PYPI_TEST_TOKEN }}
poetry publish

cd ../gridappsd-field-bus-lib
poetry config pypi-token.testpypi ${{ secrets.PYPI_TEST_TOKEN }}
poetry publish
poetry config pypi-token.testpypi ${{ secrets.PYPI_TEST_TOKEN }}
poetry publish
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@ ENV/

# pytest cache
.pytest_cache

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ repos:
description: "A formatter for Python files."
entry: yapf
language: python
types: [ python ]
types: [ python ]
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include gridappsd/conf/*
include gridappsd/conf/*
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ integration tests available to be run. In order to execute these, you must have
as above with dev-dependencies.

During the testing phase the docker containers required for the tests are downloaded from
dockerhub and started. By default the `develop` tag is used to test the library using pytest.
dockerhub and started. By default the `develop` tag is used to test the library using pytest.
One can customize the docker image tag by setting the environmental
variable `GRIDAPPSD_TAG_ENV` either by `export GRIDAPPSD_TAG_ENV=other_tag` or by executing
variable `GRIDAPPSD_TAG_ENV` either by `export GRIDAPPSD_TAG_ENV=other_tag` or by executing
pytest with the following:

```shell script
Expand All @@ -190,7 +190,7 @@ pytest with the following:
export GRIDAPPSD_TAG_ENV=other_tag
pytest

# Tests also require the username and password to be avaialable as environmental variables
# Tests also require the username and password to be avaialable as environmental variables
# in order for them to properly run these tests
export GRIDAPPSD_USER=user
export GRIDAPPSD_PASSWORD=pass
Expand All @@ -200,18 +200,18 @@ pytest

***NOTE: the first running the tests will download all of the docker images associated with the
[GOSS-GridAPPS-D](http://github.com/GRIDAPPSD/GOSS-GridAPPS-D) repository. This process may take some time.***

### Running tests created in a new project

The `gridappsd-python` library exposes a testing environment through the `gridappsd.docker_handler` module. Including the following
`conftest.py` in the root of your base test directory allows tests to reference these. Using these fixtures will start all of the
base containers required for `gridappsd` to run.
base containers required for `gridappsd` to run.

```python

# conftest.py
# Create a conftest.py file in the root of the tests directory to enable usage throughout the tests directory and below.
#
# Create a conftest.py file in the root of the tests directory to enable usage throughout the tests directory and below.
#
# Tested project structure an layout
#
# project-folder\
Expand Down Expand Up @@ -303,7 +303,7 @@ Using the above fixtures from inside a test module and test function looks like

```python

# Example test function using the gridappsd_client fixture
# Example test function using the gridappsd_client fixture

@mock.patch.dict(os.environ, {"GRIDAPPSD_APPLICATION_ID": "helics_goss_bridge.py"})
def test_gridappsd_status(gridappsd_client):
Expand All @@ -325,4 +325,3 @@ def test_gridappsd_status(gridappsd_client):
assert gappsd.get_service_status() == ProcessStatusEnum.COMPLETE.value
assert gappsd.get_application_status() == ProcessStatusEnum.COMPLETE.value
```

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023.5.1
2023.5.1
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
27 changes: 10 additions & 17 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
import os
import sys
# insert top level of project to the path.
print("PATH IS: "+os.path.abspath("../../"))
print("PATH IS: " + os.path.abspath("../../"))
sys.path.insert(0, os.path.abspath('../../'))


# -- Project information -----------------------------------------------------

project = u'GridAPPS-D Python'
Expand All @@ -30,7 +29,6 @@
# The full version, including alpha/beta/rc tags
release = u'1.0'


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -80,7 +78,6 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -110,13 +107,11 @@
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'GridAPPS-DPythondoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
Expand Down Expand Up @@ -145,16 +140,12 @@
u'Craig Allwardt', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'gridapps-dpython', u'GridAPPS-D Python Documentation',
[author], 1)
]

man_pages = [(master_doc, 'gridapps-dpython',
u'GridAPPS-D Python Documentation', [author], 1)]

# -- Options for Texinfo output ----------------------------------------------

Expand All @@ -167,7 +158,6 @@
'Miscellaneous'),
]


# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
Expand Down Expand Up @@ -195,7 +185,6 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}


import subprocess


Expand All @@ -208,17 +197,21 @@ def setup(app):
:param app:
"""
app.connect('builder-inited', generate_apidoc)


# app.connect('build-finished', clean_apirst)


def generate_apidoc(app):
print('BUILIDING api docs '+ __file__)
print('CWD: '+os.getcwd())
print('BUILIDING api docs ' + __file__)
print('CWD: ' + os.getcwd())

gridappsd_src = '../gridappsd'
if os.environ.get("READTHEDOCS"):
gridappsd_src = '../../gridappsd'
cmd = ["sphinx-apidoc", '-M', '-d 4', '-o', 'source', '--force', gridappsd_src]
cmd = [
"sphinx-apidoc", '-M', '-d 4', '-o', 'source', '--force', gridappsd_src
]

subprocess.check_call(cmd)
# print(path_to_src)
Expand Down
2 changes: 0 additions & 2 deletions docs/source/gridappsd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,3 @@ gridappsd.topics module
:members:
:undoc-members:
:show-inheritance:


Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
from gridappsd.field_interface.context import LocalContext
from gridappsd.field_interface.interfaces import MessageBusDefinition

__all__: List[str] = [
"LocalContext",
"MessageBusDefinition"
]
__all__: List[str] = ["LocalContext", "MessageBusDefinition"]
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
from typing import List

from gridappsd.field_interface.agents.agents import (
FeederAgent,
DistributedAgent,
CoordinatingAgent,
SwitchAreaAgent,
SecondaryAreaAgent
)
from gridappsd.field_interface.agents.agents import (FeederAgent, DistributedAgent,
CoordinatingAgent, SwitchAreaAgent,
SecondaryAreaAgent)

__all__: List[str] = [
"FeederAgent",
"DistributedAgent",
"CoordinatingAgent"
]
__all__: List[str] = ["FeederAgent", "DistributedAgent", "CoordinatingAgent"]
Loading