Skip to content
Open
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
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## This is currently not working, please don't try this yet ##

FROM python:3.9.14

# Dockerfile author
MAINTAINER Jay Johnson (jjohns2@sandia.gov)

# update, install prerequisites, and add a user
# RUN apt-get update && apt-get upgrade -y
# RUN apt install build-essential vim nano -y
RUN useradd -m -s /bin/bash svp_user
USER svp_user

# copy in the code
COPY * /home/svp_user/
WORKDIR /home/svp_user

RUN pip install wheel
RUN pip install attrdict
#RUN mkdir /home/svp_user/wheels
#RUN pip wheel --wheel-dir=/home/svp_user/wheels --requirement /home/svp_user/svp_requirements.txt
RUN pip install --no-cache-dir -r /home/svp_user/svp_requirements.txt

CMD [ "python", "./ui.py" ]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[CanmetENERGY-Varennes](https://www.nrcan.gc.ca/science-data/research-centres-labs/canmetenergy-research-centres/varennes-qc-research-centre/5761) is a research center designing and implementing clean energy solutions, and build on knowledge that helps produce and use energy in ways that are more efficient and sustainable.

This repository contains all of the open-source OpenSVP components written in Python 3.7
This repository contains all of the open-source OpenSVP components written in Python 3.7. Python 3.9+ does not appear to be compatible with the wxPython version. More development on ui.py is needed.


## Contribution
Expand Down Expand Up @@ -39,8 +39,8 @@ For any bugs/issues, please refer to the [bug tracker][bug-tracker-url] section.


[bug-tracker-url]: https://github.com/sunspec/svp/issues
[1547-1-url]: https://github.com/jayatsandia/svp_1547.1/tree/master3.7
[1547-1-url]: https://github.com/jayatsandia/svp_1547.1
[1741SA-url]: https://github.com/sunspec/svp_UL1741SA/tree/dev/UL1741%20SA
[4777-2-url]: https://github.com/BuiMCanmet/DR_AS-NZS-Scripts/tree/master
[svpelab-url]: https://github.com/sunspec/svp_energy_lab/tree/dev37
[4777-2-url]: https://github.com/BuiMCanmet/DR_AS-NZS-Scripts
[svpelab-url]: https://github.com/sunspec/svp_energy_lab

11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "1"

services:
app:
image: svp:latest
build: .
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
network_mode: host
4 changes: 4 additions & 0 deletions poetry-svp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Poetry Environment for the SVP

Please refer to [https://github.com/jayatsandia/svp/wiki/Installation](https://github.com/jayatsandia/svp/wiki/Installation)
for details on its use.
Empty file.
15 changes: 15 additions & 0 deletions poetry-svp/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.poetry]
name = "poetry-svp"
version = "0.1.0"
description = ""
authors = ["Jay Johnson <jjohns2@sandia.gov>"]
readme = "README.md"
packages = [{include = "poetry_svp"}]

[tool.poetry.dependencies]
python = ">=3.7.* <3.9.13"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Empty file added poetry-svp/tests/__init__.py
Empty file.
866 changes: 866 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[tool.poetry]
name = "poetry-svp"
version = "0.1.0"
description = "Poetry SVP"
authors = ["Jay Johnson <jjohns2@sandia.gov>"]
license = "MIT"
readme = "README.md"
packages = [{include = "poetry_svp"}]

[tool.poetry.dependencies]
python = ">3.8.* <3.10.0"
numpy = "^1.24.1"
pandas = "^1.5.2"
cycler = "^0.11.0"
et-xmlfile = "^1.1.0"
future = "^0.18.2"
iso8601 = "^1.1.0"
jdcal = "^1.4.1"
kiwisolver = "^1.4.4"
matplotlib = "^3.6.2"
openpyxl = "^3.0.10"
pillow = "^9.3.0"
prettytable = "^3.5.0"
pydaqmx = "^1.4.6"
pymodbus = "^3.0.2"
pyparsing = "^3.0.9"
pysunspec = "^2.1.1"
pysunspec2 = "^1.0.8"
python-dateutil = "^2.8.2"
pytz = "^2022.7"
pyvisa = "^1.13.0"
pyyaml = "^6.0"
serial = "^0.0.97"
six = "^1.16.0"
wxmplot = "^0.9.53"
wxpython = "^4.2.0"
xlsxwriter = "^3.0.4"
natsort = "^8.2.0"
urllib3 = "^1.26.13"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
31 changes: 31 additions & 0 deletions svp_install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# PowerShell script to install the SVP

# Delete old directory and create new directory
Remove-Item "svp_software" -Recurse -Force
Write-Output "Creating svp_software\ directory"
New-Item "svp_software" -itemType Directory
Set-Location "svp_software"

# Clone the software of interest - need to have SSH keys
Write-Output "Using SSH to git clone directories."
Write-Output "Confirm keys are in %HOME%\.ssh\config\"

git clone git@github.com:jayatsandia/svp.git --verbose
git clone git@github.com:jayatsandia/svp_1547.1.git --verbose
git clone git@github.com:jayatsandia/svp_UL1741SA.git --verbose
git clone git@github.com:jayatsandia/svp_energy_lab.git --verbose
git clone git@github.com:jayatsandia/svp_additional_tools.git --verbose

# Copy SVP Energy Lab files into Working Directories
Write-Output "Moving the SVP Energy Lab into each working directory"
Copy-Item -Path "svp_energy_lab\Lib" -Destination "svp_additional_tools\" -Recurse
Copy-Item -Path "svp_energy_lab\Lib" -Destination "svp_UL1741SA\UL1741 SA\" -Recurse

Copy-Item -Path "svp_energy_lab\Lib\svpdnp3" -Destination "svp_1547.1\1547.1\Lib\" -Recurse
Copy-Item -Path "svp_energy_lab\Lib\svpelab\*" -Destination "svp_1547.1\1547.1\Lib\svpelab\" -Recurse

Write-Output "Downloading python dependencies"
pip3 install -r svp/svp_requirements.txt

Write-Output "Starting the SVP..."
python3 svp/ui.py
63 changes: 63 additions & 0 deletions svp_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/bash

# Set the git directories to pull down code
SSH_OR_HTTPS="SSH"

if [[ "$SSH_OR_HTTPS" == "HTTPS" ]]; then
echo "Cloning repositories using the $SSH_OR_HTTPS method."
SVP="https://github.com/jayatsandia/svp.git"
# Alternative: "https://github.com/sunspec/svp.git"

declare -a WORKING_DIRECTORIES=(\
"https://github.com/jayatsandia/svp_1547.1.git" \
"https://github.com/jayatsandia/svp_UL1741SA.git" \
"https://github.com/jayatsandia/svp_energy_lab.git" \
"https://github.com/jayatsandia/svp_additional_tools.git" \
#"https://github.com/jayatsandia/svp_additional_tools.git"\
)

else
echo "Cloning repositories using the $SSH_OR_HTTPS method."
SVP="git@github.com:jayatsandia/svp.git"
# Alternative: "git@github.com:sunspec/svp.git"

declare -a WORKING_DIRECTORIES=(\
"git@github.com:jayatsandia/svp_1547.1.git" \
"git@github.com:jayatsandia/svp_UL1741SA.git" \
"git@github.com:jayatsandia/svp_energy_lab.git" \
"git@github.com:jayatsandia/svp_additional_tools.git" \
#"git@github.com:jayatsandia/svp_additional_tools.git"\
)

fi

if [ -d "./svp_software" ]
then
echo "Removing svp_software directory"
rm -rf svp_software
else
echo "No svp_software directory found"
fi

mkdir svp_software
cd svp_software

git clone "$SVP"
for repo in "${WORKING_DIRECTORIES[@]}"; do
echo "Cloning: $repo"
git clone "$repo"
done

echo "Moving the SVP Energy Lab into each working directory"
cp -r svp_energy_lab/Lib/svpelab/* svp_1547.1/1547.1/Lib/svpelab/
cp -r svp_energy_lab/Lib/svpdnp3 svp_1547.1/1547.1/Lib/

cp -r svp_energy_lab/Lib svp_additional_tools/

cp -r svp_energy_lab/Lib svp_UL1741SA/UL1741\ SA

echo "Downloading python dependencies"
pip3 install -r svp/svp_requirements.txt

echo "Starting the SVP"
python3 svp/ui.py
57 changes: 29 additions & 28 deletions svp_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
numpy
pandas
cycler
et-xmlfile
future
iso8601
jdcal
kiwisolver
matplotlib
openpyxl
Pillow
prettytable
PyDAQmx
pymodbus
pyparsing
pyserial
git+https://github.com/sunspec/pysunspec@master#egg=pysunspec
python-dateutil
pytz
PyVISA
PyYAML
serial
six
typing
wxmplot
wxPython==4.0.7.post2
XlsxWriter
natsort
numpy
pandas
cycler
et-xmlfile
future
iso8601
jdcal
kiwisolver
matplotlib
openpyxl
Pillow
prettytable
PyDAQmx
pymodbus
pyparsing
pyserial
pysunspec
pysunspec2
python-dateutil
pytz
PyYAML
serial
six
wxmplot
wxPython
XlsxWriter
natsort
urllib3
pyvisa
10 changes: 5 additions & 5 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3262,7 +3262,7 @@ def render_info(self, parent):
### try to catch all exceptions if bitmap read fails
bitmap = wx.Bitmap(os.path.join(logo_path, svp.SCRIPTS_DIR, logo))
logo_h_sizer.Add(wx.StaticBitmap(parent=title, bitmap=bitmap), 0, wx.LEFT, 10)
logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM)
# logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM)

params_panel = wx.Panel(info_panel, -1)
params_panel.panel_sizer = wx.GridBagSizer(hgap=30, vgap=0)
Expand Down Expand Up @@ -3581,7 +3581,7 @@ def render_info(self, parent):
### try to catch all exceptions if bitmap read fails
bitmap = wx.Bitmap(os.path.join(logo_path, svp.SCRIPTS_DIR, logo))
logo_h_sizer.Add(wx.StaticBitmap(parent=title, bitmap=bitmap), 0, wx.LEFT, 10)
logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM|wx.LEFT, 60)
# logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM|wx.LEFT, 60)

row = 0
params_panel = wx.Panel(info_panel, -1)
Expand Down Expand Up @@ -3803,7 +3803,7 @@ def render_info(self, parent):
### try to catch all exceptions if bitmap read fails
bitmap = wx.Bitmap(os.path.join(logo_path, svp.SCRIPTS_DIR, logo))
logo_h_sizer.Add(wx.StaticBitmap(parent=title, bitmap=bitmap), 0, wx.LEFT, 10)
logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM|wx.LEFT, 60)
# logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM|wx.LEFT, 60)

row = 0
params_panel = wx.Panel(info_panel, -1)
Expand Down Expand Up @@ -3916,7 +3916,7 @@ def render_info(self, parent):
### try to catch all exceptions if bitmap read fails
bitmap = wx.Bitmap(os.path.join(logo_path, svp.SCRIPTS_DIR, logo))
logo_h_sizer.Add(wx.StaticBitmap(parent=title, bitmap=bitmap), 0, wx.LEFT, 10)
logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM|wx.LEFT, 60)
# logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM|wx.LEFT, 60)

row = 0
params_panel = wx.Panel(info_panel, -1)
Expand Down Expand Up @@ -4023,7 +4023,7 @@ def render_info(self, parent):
### try to catch all exceptions if bitmap read fails
bitmap = wx.Bitmap(os.path.join(logo_path, svp.SCRIPTS_DIR, logo))
logo_h_sizer.Add(wx.StaticBitmap(parent=title, bitmap=bitmap), 0, wx.LEFT, 10)
logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM|wx.LEFT, 60)
# logo_sizer.Add(logo_h_sizer, 0, wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM|wx.LEFT, 60)

row = 0
params_panel = wx.Panel(info_panel, -1)
Expand Down