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

Add encoding to swmm_report_compare #126

Closed
wants to merge 17 commits into from
96 changes: 96 additions & 0 deletions .github/workflows/wheel_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Wheel build

on:
pull_request:
branches:
- master
push:
branches:
- dev
workflow_dispatch:

jobs:
build_nrtest_plugin:
name: Build nrtest-swmm plugin
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./nrtest-swmm

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Build wheel
run: |
pip install wheel
python setup.py bdist_wheel

- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: nrtest-swmm-wheel
path: nrtest-swmm/dist/*.whl


build_swmm_lib:
name: Build swmm library
runs-on: windows-2019
defaults:
run:
shell: bash
working-directory: swmm-toolkit/swmm-solver/ci-tools/linux

steps:
- name: Checkout swmm-python repo
uses: actions/checkout@v3
with:
submodules: true

- name: Checkout ci-tools repo
uses: actions/checkout@v3
with:
repository: michaeltryby/ci-tools
ref: master
path: swmm-toolkit/swmm-solver/ci-tools

- name: Build
run: ./make.sh -g "Visual Studio 16 2019"

- name: Upload dependency
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: swmm-lib
path: swmm-toolkit/swmm-solver/upload/*.*


build_swmm_wheel:
name: Build swmm-toolkit wheel
needs: [ build_swmm_lib ]
runs-on: windows-2019
defaults:
run:
shell: bash
working-directory: ./swmm-toolkit

steps:
- name: Checkout swmm-python repo
uses: actions/checkout@v3
with:
submodules: false

- name: Download dependency
uses: actions/download-artifact@v3
with:
name: swmm-lib
path: ./swmm-toolkit/extern

- name: Build wheel in virtual env
run: |
ls extern
11 changes: 6 additions & 5 deletions nrtest-swmm/nrtest_swmm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# __init__.py - nrtest_swmm module
#
# Author: Michael E. Tryby
# US EPA - ORD/NRMRL
# US EPA - ORD/CESER
#

'''
Expand All @@ -25,8 +25,8 @@
__credits__ = "Colleen Barr, Maurizio Cingi, Mark Gray, David Hall, Bryant McDonnell"
__license__ = "CC0 1.0 Universal"

__version__ = "0.7.0"
__date__ = "Jul 28, 2021"
__version__ = "0.8.0"
__date__ = "Oct 17, 2023"

__maintainer__ = "Michael E. Tryby"
__email__ = "[email protected]"
Expand Down Expand Up @@ -108,9 +108,10 @@ def swmm_report_compare(path_test, path_ref, rtol, atol):
HEADER = 4
FOOTER = 4

with open(path_test ,'r') as ftest, open(path_ref, 'r') as fref:
with open(path_test ,'r', encoding="ISO-8859-1") as ftest, \
open(path_ref, 'r', encoding="ISO-8859-1") as fref:

for (test_line, ref_line) in zip(hdf.parse(ftest, HEADER, FOOTER)[1],
for (test_line, ref_line) in zip(hdf.parse(ftest, HEADER, FOOTER)[1], \
hdf.parse(fref, HEADER, FOOTER)[1]):

if test_line != ref_line:
Expand Down
4 changes: 2 additions & 2 deletions nrtest-swmm/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Author: Michael E. Tryby
# US EPA - ORD/NRMRL
#
# Modified: Jul 28, 2021
# Modified: Oct 17, 2023
#
# Usage:
# \>python setup.py bdist_wheel
Expand All @@ -27,7 +27,7 @@

setup(
name='nrtest-swmm',
version='0.7.0',
version='0.8.0',
description="SWMM extension for nrtest",

author="Michael E. Tryby",
Expand Down