Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AGVis Update 4.0 #72

Merged
merged 100 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
5c4db2b
Legend.js
zmalkmus Sep 13, 2023
32120d7
Window.js
zmalkmus Sep 15, 2023
c020c9e
Window.js
zmalkmus Sep 15, 2023
23ef6f0
Updating Window.js comments
zmalkmus Sep 15, 2023
4cb1664
Updating CanvasLayer.js comments
zmalkmus Sep 15, 2023
4154216
Added CommunicationLayer.js header comment.
zmalkmus Sep 15, 2023
1200969
Overhauling developer comments
zmalkmus Sep 16, 2023
ce66d9a
Updating ContMulti.js comments
zmalkmus Sep 16, 2023
11c2127
Dev comments
zmalkmus Sep 19, 2023
0bea9b3
Dev comments
zmalkmus Sep 19, 2023
8966828
Dev comments
zmalkmus Sep 21, 2023
6c77515
LayerControl.js Comments
zmalkmus Sep 21, 2023
2e1427d
CanvasLayer comments
zmalkmus Sep 21, 2023
75e0740
ContMulti.js comments
zmalkmus Sep 21, 2023
2af4368
NDArray comments
zmalkmus Sep 21, 2023
66bc7d7
Fixed header comment formatting
zmalkmus Sep 21, 2023
5377345
Fixed header comment formatting
zmalkmus Sep 21, 2023
e5715f9
PlaybackControl.js Comments
zmalkmus Sep 21, 2023
0edf3f4
Updating PlaybackControl.js comments
zmalkmus Sep 26, 2023
d65ec30
PlayMulti.js comments
zmalkmus Sep 26, 2023
dc2ed69
PlayMulti.js comments
zmalkmus Sep 26, 2023
5f7abb8
SearcLayer.js Comments
zmalkmus Sep 26, 2023
c1dcc6d
Merge pull request #57 from CURENT/master
jinningwang Sep 26, 2023
fc9df7f
TimeBox.js Comments
zmalkmus Sep 26, 2023
efa19ee
TimeBox.js Comments
zmalkmus Sep 26, 2023
3b2c84e
TopMulti.js comments
zmalkmus Sep 26, 2023
63541e9
TopMulti.js comments
zmalkmus Sep 28, 2023
48d1fe7
Finishing touches
zmalkmus Sep 28, 2023
67c2b53
Finishing touches
zmalkmus Sep 28, 2023
4011728
Merge pull request #58 from CURENT/js-file-commenting
jinningwang Sep 28, 2023
62980e1
Added windows support for the agvis run command
zmalkmus Oct 5, 2023
437eacb
Updated usage documentation for Windows
zmalkmus Oct 5, 2023
32c0d4d
Setting up tests folder
zmalkmus Oct 5, 2023
959a679
Runs server start command from the app.py directory
zmalkmus Oct 11, 2023
8f69adc
Merge pull request #60 from CURENT/windows-support
jinningwang Oct 11, 2023
5970050
basic test setup
zmalkmus Oct 16, 2023
63147d1
updated requirements
zmalkmus Oct 18, 2023
4322881
updating requirements
zmalkmus Oct 18, 2023
914ef6c
Initial restructure of AGVis backend
zmalkmus Oct 18, 2023
50b01df
AGVis backend restructure
zmalkmus Oct 20, 2023
6cf58e1
Finished backend restructure. Added dev mode.
zmalkmus Oct 20, 2023
3c27fb4
fixed typo
zmalkmus Oct 25, 2023
d619d2c
fixed typo in go.sh
zmalkmus Oct 25, 2023
dd71c0c
Updated agvis repository Docker uses
zmalkmus Oct 25, 2023
78b5593
Fixed agvis pip install in Docker container
zmalkmus Oct 26, 2023
a496754
Added shell=False to subprocess
zmalkmus Oct 26, 2023
7398147
Changed subprocess command for testing
zmalkmus Oct 26, 2023
02328b3
Disabled running from directory. Currently breaks Docker.
zmalkmus Oct 26, 2023
41e964b
reenabled popen for subprocess
zmalkmus Oct 26, 2023
5a86b8a
reenabled popen for subprocess
zmalkmus Oct 26, 2023
ba53035
Fixed Docker issue. Added ability to build different branches using .…
zmalkmus Nov 3, 2023
7301fd2
removed ! from go.sh
zmalkmus Nov 7, 2023
51c2c92
Removed all syntax errors relating to an extra ! at the end
zmalkmus Nov 7, 2023
a090dde
Cleaned up object oriented implementation of flask app
zmalkmus Nov 7, 2023
96c603c
Testing Web App
zmalkmus Nov 7, 2023
08253ce
Writing tests
zmalkmus Nov 9, 2023
20df131
tests
zmalkmus Nov 14, 2023
465afdd
conftest
zmalkmus Nov 14, 2023
c368cc0
dime testing
zmalkmus Nov 14, 2023
d1e306e
Added header comments. Finished initial dime_client test for agvis
zmalkmus Nov 16, 2023
b34dc5e
Updated test name
zmalkmus Nov 16, 2023
c2e0ada
disabled docker test, looking into js testing
zmalkmus Nov 20, 2023
2117e8a
adding tests for web
zmalkmus Nov 20, 2023
6c1b7a4
client tests
zmalkmus Nov 20, 2023
331cf5f
removed redundant test
zmalkmus Nov 20, 2023
8742420
Added header comment and removed unused imports
zmalkmus Nov 20, 2023
a4dc9fc
Created docker test file
zmalkmus Dec 8, 2023
16e65a7
debug ./go.sh file not being found
zmalkmus Dec 8, 2023
5fde49a
debug ./go.sh file not being found
zmalkmus Dec 8, 2023
a378a79
debug ./go.sh file not being found
zmalkmus Dec 8, 2023
3d2de10
Added checking out of code
zmalkmus Dec 8, 2023
6b97b2c
updated go.sh script to include docker testing
zmalkmus Dec 8, 2023
003114f
removed interactive tag
zmalkmus Dec 8, 2023
f951789
Disabling basic dime testing. Will keep the file in case it is needed…
zmalkmus Dec 8, 2023
ea4650c
added PR unit test protection for master
zmalkmus Dec 8, 2023
edc350d
Merge pull request #63 from CURENT/docker-agvis-bug
zmalkmus Dec 15, 2023
f717c5c
Resolving conflicts
zmalkmus Dec 15, 2023
15d2e0f
Merge pull request #64 from CURENT/unittesting
zmalkmus Dec 15, 2023
d03a287
Custom Flask Configurations for AGVis
zmalkmus Jan 18, 2024
505b125
Merge pull request #67 from CURENT/flask-config
zmalkmus Jan 20, 2024
b57aa97
Include pip upgrade in Dockerfile
zmalkmus Jan 20, 2024
7eae9b3
Update citation
Feb 2, 2024
9d99a26
Update copyright
Feb 2, 2024
bd5488c
Merge pull request #68 from jinningwang/release
zmalkmus Feb 3, 2024
cf67459
Merge remote-tracking branch 'origin/master' into develop
zmalkmus Feb 26, 2024
6f3b67a
Updated max zoom
zmalkmus Mar 18, 2024
ff170d2
Merge pull request #71 from CURENT/map-zoom
zmalkmus Mar 27, 2024
973f011
Rename test.yml to pythonapp.yml
zmalkmus Apr 3, 2024
d53cecf
Update pythonapp.yml
zmalkmus Apr 5, 2024
9dec485
Update dependency versions on pythonapp.yml
zmalkmus Apr 5, 2024
38cead8
Added linting with flake8
zmalkmus Apr 5, 2024
f05c2f9
Remove flake 8 until its recommended fixes are corrected.
zmalkmus Apr 5, 2024
98f69eb
Publish Python to PyPI in pythonapp.yml
zmalkmus Apr 5, 2024
722b24d
Merge branch 'master' into develop
zmalkmus Apr 22, 2024
9dc5d49
Fixed broken tests. Added agvis selftest functionality
zmalkmus May 8, 2024
8d6ad9b
Fixing last unittest
zmalkmus May 8, 2024
f074dd2
Removing problematic test working locally but not on github
zmalkmus May 8, 2024
be0fd46
Merge pull request #73 from CURENT/enable-unittest-cli
zmalkmus May 8, 2024
28b36a1
Cleaning up code for codacy
zmalkmus May 8, 2024
4fb5bcc
Merge pull request #74 from CURENT/codacy-cleanup
zmalkmus May 8, 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
61 changes: 61 additions & 0 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Python application

on: [push, pull_request]

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

test:
name: Run test suite
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build the Docker image
run: ./go.sh build
- name: Run tests
run: ./go.sh run_tests
# Developer note: Fix flake8 errors before uncommenting here.
# - name: Lint with flake8 for pull requests
# if: github.event_name == 'pull_request'
# run: |
# pip install flake8 # specify flake8 to avoid unknown error
# # stop the build if there are Python syntax errors or undefined names
# flake8 .

publish-to-pypi:
name: Publish Python distribution to PyPI
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs:
- build
- test
runs-on: ubuntu-latest
steps:
- name: Publish Python dist to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
10 changes: 10 additions & 0 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@INPROCEEDINGS{10318583,
author={Parsly, Nicholas and Wang, Jinning and West, Nick and Zhang, Qiwei and Cui, Hantao and Li, Fangxing},
booktitle={2023 North American Power Symposium (NAPS)},
title={DiME and AGVis: A Distributed Messaging Environment and Geographical Visualizer for Large-Scale Power System Simulation},
year={2023},
volume={},
number={},
pages={1-5},
keywords={Power system simulation;Data visualization;Distributed databases;Nonhomogeneous media;Real-time systems;Power systems;North America;Power grid;Open-source software;Large-scale system;High-concurrency Data;Geovisualization;Digital twin},
doi={10.1109/NAPS58826.2023.10318583}}
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Start with a base Python 3.10 image from the Debian Buster distribution
FROM python:3.10-buster AS base
ARG BRANCH_NAME

# Switch to the root user and set the working directory to /root
USER root
Expand All @@ -18,14 +19,12 @@ RUN apt update \
libev-dev \
&& rm -rf /var/lib/apt/lists/*

RUN python3 -m pip install --upgrade pip

# Install the necessary Python packages
RUN python3 -m pip install \
kvxopt \
git+https://github.com/cuihantao/andes.git@develop \
--no-cache-dir \
&& python3 -m pip install \
git+https://github.com/zmalkmus/agvisdev.git \
# git+https://github.com/CURENT/agvis.git \
--no-cache-dir

# Create a new user named 'cui' and a work directory
Expand All @@ -50,6 +49,11 @@ RUN git clone https://github.com/CURENT/dime.git && \
rm -rf dime \
&& rm -rf /tmp/dime

RUN git clone --single-branch --branch unittesting https://github.com/CURENT/agvis.git && \
cd agvis && \
python3 -m pip install -e . && \
cd ..

# Switch to the 'cui' user and set the working directory to the new user's work directory
USER cui
WORKDIR /home/cui/work
Expand All @@ -62,4 +66,4 @@ COPY . .

# Set the entrypoint and command for the container
ENTRYPOINT []
CMD []
CMD []
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ AGVis is currently under active development. Use the following resources to get
+ Report bugs or issues by submitting a [GitHub issue][GitHub issues]
+ Submit contributions using [pull requests][GitHub pull requests]
+ Read release notes highlighted [here][release notes]
+ Check out and cite our [paper][arxiv paper]
+ Check out and cite our [paper][naps paper]

# Citing AGVis

If you use AGVis for research or consulting, please cite the following publications in your publication:

> Parsly, N., Wang, J., West, N., Zhang, Q., Cui, H., & Li, F. (2022). "DiME and AGVIS A Distributed Messaging Environment and Geographical Visualizer for Large-scale Power System Simulation". arXiv. https://doi.org/https://arxiv.org/abs/2211.11990v1
> N. Parsly, J. Wang, N. West, Q. Zhang, H. Cui and F. Li, "DiME and AGVis: A Distributed Messaging Environment and Geographical Visualizer for Large-Scale Power System Simulation," 2023 North American Power Symposium (NAPS), Asheville, NC, USA, 2023, pp. 1-5, doi: 10.1109/NAPS58826.2023.10318583.

Please refer as **LTB AGVis** for the first occurence and then refer as **AGVis**.

Expand Down Expand Up @@ -70,7 +70,7 @@ AGVis is licensed under [GPL v3 License](./LICENSE)
[readthedocs]: https://agvis.readthedocs.io
[advanced usage]: https://agvis.readthedocs.io/en/latest/usage/index.html
[release notes]: https://agvis.readthedocs.io/en/latest/release-notes.html
[arxiv paper]: https://arxiv.org/abs/2211.11990
[naps paper]: https://ieeexplore.ieee.org/document/10318583
[tutorial]: https://agvis.readthedocs.io/en/latest/getting_started/tutorial/index.html
[LTB Repository]: https://github.com/CURENT
[Visualization Gallery]: https://ltb.readthedocs.io/projects/agvis/en/latest/getting_started/testcases.html#visualization-gallery
Expand Down
2 changes: 1 addition & 1 deletion agvis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__version__ = _version.get_versions()['version']

from agvis.main import config_logger # NOQA
from agvis.app import run_app
from agvis.web import AgvisWeb

__author__ = 'Nicholas West, Nicholas Parsly, Zack Malkmus, and Jinning Wang'

Expand Down
45 changes: 0 additions & 45 deletions agvis/app.py

This file was deleted.

4 changes: 1 addition & 3 deletions agvis/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def create_parser():
run = sub_parsers.add_parser('run')
run.add_argument('--host', default='127.0.0.1', help='Host to bind the server (default: 127.0.0.1)')
run.add_argument('--port', default=8810, type=int, help='Port to bind the server (default: 8810)')
run.add_argument('--dev', default=False, type=bool, help='Run AGVis in development mode (default: False)')
# run.add_argument('--static', default=None, help='Static path to serve (default: None)')

misc = sub_parsers.add_parser('misc')
Expand All @@ -54,8 +55,6 @@ def create_parser():

selftest = sub_parsers.add_parser('selftest', aliases=command_aliases['selftest'])

demo = sub_parsers.add_parser('demo') # NOQA

return parser


Expand Down Expand Up @@ -107,7 +106,6 @@ def main():
# Run the command
if args.command is None:
parser.parse_args(sys.argv.append('--help'))

else:
cmd = args.command
for fullcmd, aliases in command_aliases.items():
Expand Down
21 changes: 21 additions & 0 deletions agvis/flask_configurations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ================================================================================
# File Name: flask_configurations.py
# Author: Zack Malkmus
# Date: 1/18/2024 (created)
# Description: Configuration file for FLASK APP
# ================================================================================

class DefaultConfig(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True

class ProductionConfig(DefaultConfig):
DEBUG = False

class DevelopmentConfig(DefaultConfig):
DEVELOPMENT = True
DEBUG = True

class TestingConfig(DefaultConfig):
TESTING = True
35 changes: 15 additions & 20 deletions agvis/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
import pprint
import logging
import tempfile

import subprocess
from ._version import get_versions

from andes.utils.misc import is_interactive
import agvis
from agvis.web import AgvisWeb

logger = logging.getLogger(__name__)
agvis_web = AgvisWeb()

app = agvis_web.app

logger = logging.getLogger(__name__)

def config_logger(stream_level=logging.INFO, *,
stream=True,
Expand Down Expand Up @@ -171,8 +174,8 @@ def remove_output(recursive=False):


def run(filename='', input_path='', verbose=20,
host='localhost', port=8810, socket_path=None,
static=None,
host='localhost', port=8810, dev=False,
socket_path=None, static=None,
**kwargs):
"""
Entry point to run AGVis.
Expand Down Expand Up @@ -209,7 +212,7 @@ def run(filename='', input_path='', verbose=20,
cases = _find_cases(filename, input_path) #NOQA

# Run the flask web app
agvis.app.run_app("agvis.app:app", host=host, port=port)
agvis_web.run(host=host, port=port, dev=dev)

return True

Expand Down Expand Up @@ -266,7 +269,7 @@ def print_license():
print(f"""
AGVis version {agvis.__version__}

Copyright (c) 2020-2023 Nick West, Nicholas Parsly, Jinning Wang
Copyright (c) 2020-2024 Nick West, Nicholas Parsly, Jinning Wang

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -298,10 +301,6 @@ def misc(show_license=False, clean=True, recursive=False,
remove_output(recursive)
return

if demo is True:
demo(**kwargs)
return

if version is True:
versioninfo()
return
Expand All @@ -313,15 +312,11 @@ def selftest(**kwargs):
"""
TODO: Run unit tests.
"""
logger.warning("Tests have not been implemented")


def demo(**kwargs):
"""
TODO: show some demonstrations from CLI.
"""
logger.warning("Demos have not been implemented")

# logger.warning("Tests have not been implemented")
logger.info('Running tests...')
path = os.path.dirname(os.path.abspath(__file__))
test_path = os.path.join(path, '../tests')
subprocess.run(['pytest', '-v', test_path])

def versioninfo():
"""
Expand Down
Loading