Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
fadde6e
Merge pull request #137 from GRIDAPPSD/main
tonya1 Oct 12, 2023
07fabe3
added context manager and updated to use cim-graph 1.0
poorva1209 Jan 5, 2024
7e65957
Update pyproject.toml
poorva1209 Jan 5, 2024
5760f3e
added more request types for context manager
poorva1209 Jan 5, 2024
446106b
added yapf formatting
poorva1209 Jan 8, 2024
90b802f
Update package versions in pyproject.toml files
craigpnnl Jan 9, 2024
5d02c68
Merge pull request #138 from GRIDAPPSD/start_context
craigpnnl Jan 9, 2024
3481618
Update deploy-dev-release.yml
craigpnnl Jan 10, 2024
f35cdfa
Update pyproject.toml
poorva1209 Jan 11, 2024
420e4f1
Bump version of pyproject
craigpnnl Jan 11, 2024
10f3630
Merge pull request #139 from GRIDAPPSD/poorva1209-patch-2
craigpnnl Jan 11, 2024
1a37b5d
Update pyproject.toml
craigpnnl Jan 25, 2024
6508e95
Update pyproject.toml
craigpnnl Jan 25, 2024
3aff256
Update so that the outer poetry file runs the version
craigpnnl Jan 25, 2024
dad016f
Update pyproject.toml
craigpnnl Jan 25, 2024
981e53a
added time out except
poorva1209 Feb 20, 2024
36c9482
Update context.py
poorva1209 Feb 29, 2024
657b16b
Update context.py
poorva1209 Feb 29, 2024
75d3901
Merge pull request #140 from poorva1209/develop
craigpnnl Feb 29, 2024
fd923fc
Update goss.py
poorva1209 Mar 29, 2024
908c9aa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 29, 2024
3cfca3b
Merge pull request #142 from GRIDAPPSD/Adding-millisecond-in-response…
craigpnnl Mar 29, 2024
9a3749d
adding automatic pause option to SimulationArgs
afisher1 Apr 9, 2024
461b51a
fix for issue#145
afisher1 Apr 10, 2024
1cc3bb4
exposing full json package functionality in json_extension.py
afisher1 Apr 22, 2024
70a5911
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 22, 2024
15b11b4
added logs
poorva1209 May 1, 2024
b1deea1
added logs
poorva1209 May 1, 2024
c23bf1b
Merge pull request #147 from poorva1209/develop
poorva1209 May 1, 2024
c245124
Merge pull request #144 from afisher1/feature/automaticSimulationPause
poorva1209 May 1, 2024
874cff2
Update pyproject.toml
poorva1209 May 1, 2024
f7868be
Merge pull request #146 from afisher1/bugfix/145
craigpnnl May 2, 2024
162aa18
Merge pull request #148 from GRIDAPPSD/poorva1209-patch-2
craigpnnl May 2, 2024
1100adb
adding context in init
poorva1209 May 13, 2024
965e512
Merge pull request #149 from poorva1209/develop
poorva1209 May 13, 2024
3246b8c
Update pyproject.toml
poorva1209 May 13, 2024
aa37d51
Merge pull request #150 from GRIDAPPSD/poorva1209-patch-2
poorva1209 May 13, 2024
aebb775
Update pyproject.toml for release
tonya1 Jul 9, 2024
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'
61 changes: 31 additions & 30 deletions .github/workflows/deploy-dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,34 @@ jobs:
# we need to remove the v from the beginning of the tag.
# echo "Bump rule is ${{ inputs.bump-rule }}"
# echo "Given release version is ${{ inputs.release-version }}"
dt=$(date +%Y.%-m.0)
if ! $(git tag -l "v*" = ''); then
# uses -V which is version sort to keep it monotonically increasing.
current_tag=$(git tag -l "v*" | grep --invert-match '-' | sort --reverse -V | sed -n 1p)
echo "current git tag is ${current_tag}"
current_tag=${current_tag#?}
if [[ "$current_tag" < "$dt" ]]; then
current_tag=$dt
fi
# current_tag is now the version we want to set our poetry version so
# that we can bump the version
./scripts/run_on_each.sh poetry version ${current_tag}
./scripts/run_on_each.sh poetry version prerelease

# poetry version ${current_tag}
# poetry version prerelease --no-interaction

else
# very first release. start with inputs.release-version

echo "First release. Setting tag as 0.1.0rc0"
current_tag=$(date +%Y.%-m.1)
./scripts/run_on_each.sh poetry version ${current_tag}

# poetry version ${current_tag}
fi
# dt=$(date +%Y.%-m.0)
# if ! $(git tag -l "v*" = ''); then
# # uses -V which is version sort to keep it monotonically increasing.
# current_tag=$(git tag -l "v*" | grep --invert-match '-' | sort --reverse -V | sed -n 1p)
# echo "current git tag is ${current_tag}"
# current_tag=${current_tag#?}
# if [[ "$current_tag" < "$dt" ]]; then
# current_tag=$dt
# fi
# # current_tag is now the version we want to set our poetry version so
# # that we can bump the version
# ./scripts/run_on_each.sh poetry version ${current_tag}
# ./scripts/run_on_each.sh poetry version prerelease

# # poetry version ${current_tag}
# # poetry version prerelease --no-interaction

# else
# # very first release. start with inputs.release-version

# echo "First release. Setting tag as 0.1.0rc0"
# current_tag=$(date +%Y.%-m.1)
# ./scripts/run_on_each.sh poetry version ${current_tag}

# # poetry version ${current_tag}
# fi
version=$(poetry version --short)
./scripts/run_on_each.sh poetry version ${version}

NEW_TAG=v$(poetry version --short)

Expand Down Expand Up @@ -175,11 +177,10 @@ 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

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