Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Update user manuals #862

Merged
merged 123 commits into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
33fbfec
Create user manual outline
dchassin Mar 21, 2021
127b349
Update outlines
dchassin Mar 21, 2021
a075c84
Add use-case chapters
dchassin Mar 21, 2021
867b046
Update Contents.md
dchassin Mar 21, 2021
1c005dc
Update Contents.md
dchassin Mar 21, 2021
5485216
Update Contents.md
dchassin Mar 21, 2021
325614a
Removed contexts
dchassin Mar 21, 2021
77cb75c
Update Preface.md
Mar 24, 2021
9cd4db5
Create Extern.md
Mar 30, 2021
2ed4132
Update Dump.md
Mar 30, 2021
f534a7e
Create Global.md
Mar 30, 2021
ecf1c32
Create Modify.md
Mar 30, 2021
38f1e90
Create Module.md
Mar 30, 2021
3f642c2
Create Object.md
Mar 30, 2021
aa3c3a9
Update Preface.md
Mar 30, 2021
4e69911
Update Contents.md
Mar 30, 2021
2096eb4
Add module and class guide from PNNL
Mar 30, 2021
dbfb1ae
Add develop guide stubs
Mar 30, 2021
d540a1d
Merge branch 'develop' into develop-user-manual
Mar 31, 2021
e12cf6f
Merge branch 'develop' into develop-user-manual
dchassin May 1, 2021
6636875
Update Preface.md
Jun 16, 2021
1d7e454
Merge branch 'develop' into develop-user-manual
Jun 17, 2021
c007620
Merge branch 'develop' into develop-user-manual
Jul 6, 2021
d73527c
Add autotest for deferred names
Jul 14, 2021
d6524fb
Revert "Add autotest for deferred names"
Jul 14, 2021
a4d1978
Update Preface.md
Jul 14, 2021
3468f23
Update user manual outline
Jul 15, 2021
35b6436
Fix docs TOC makefile
Jul 15, 2021
9e0fd82
Merge branch 'develop' into develop-user-manual
dchassin Jul 19, 2021
8ec744d
Merge branch 'develop' into develop-user-manual
dchassin Jul 19, 2021
eac6df1
Add @ syntax for inheriting object property values.
dchassin Jul 24, 2021
5407e1d
Update load.cpp
dchassin Jul 24, 2021
8f95107
Create Template.md
Jul 26, 2021
2ab000f
Merge branch 'develop' into develop-user-manual
Jul 26, 2021
9541bf8
Update Template.md
Jul 26, 2021
3216aca
Merge remote-tracking branch 'origin/develop-add-inherit-shorthand' i…
Jul 26, 2021
73ae2a3
Merge remote-tracking branch 'origin/develop-fix-forloop' into develo…
Jul 26, 2021
0d437c7
Update Template.md
Jul 26, 2021
69f3562
Update Template.md
Jul 26, 2021
d1240b4
Create 1 - Getting Started.md
dchassin Jul 28, 2021
025030d
Made gldcore test_filter_constraint autotest check its output
dchassin Jul 28, 2021
3141d6b
Update 1 - Getting Started.md
dchassin Jul 28, 2021
6ff02c4
Create Validation.md
dchassin Jul 28, 2021
e65ad12
Fixed test_filter_constraint autotest randomseed
dchassin Jul 28, 2021
9afe2cc
Update Validation.md
dchassin Jul 28, 2021
4bf5e2c
Create 2 - Theory of Operation.md
dchassin Jul 28, 2021
f45015c
Update 2 - Theory of Operation.md
dchassin Jul 28, 2021
9f917e2
Create 3 - Creating GLM Files.md
dchassin Jul 29, 2021
63cadd3
Update 3 - Creating GLM Files.md
dchassin Jul 29, 2021
5de7dc2
Add placeholder pages
Jul 29, 2021
a999ddf
Merge branch 'develop' into develop-user-manual
dchassin Aug 26, 2021
2782fb6
Merge branch 'develop' into develop-user-manual
Sep 1, 2021
9391149
Update work
Sep 7, 2021
e332aa6
Update work
Sep 7, 2021
dd876b1
Create .gitignore
dchassin Sep 8, 2021
62f70fe
Create Makefile
dchassin Sep 8, 2021
e0309be
Update Makefile
dchassin Sep 8, 2021
f6fd54e
Update Makefile
dchassin Sep 8, 2021
8d29f04
Create Theory.md
dchassin Sep 8, 2021
0d54aa7
Update theory tutorial
Sep 10, 2021
4005170
Update example_6.glm
Sep 10, 2021
12fdec5
Update csv-table2glm-object.py
Sep 10, 2021
aed322e
Update docs and tutorials
dchassin Sep 18, 2021
1401f9b
Merge branch 'develop-user-manual' of https://github.com/slacgismo/gr…
dchassin Sep 18, 2021
7366b3d
Merge branch 'develop' into develop-user-manual
dchassin Sep 25, 2021
1fe36af
Update tutorial.ipynb
dchassin Sep 25, 2021
0f43617
Merge branch 'develop' into develop-user-manual
dchassin Jan 7, 2022
758a678
Merge branch 'develop' into develop-user-manual
Jan 14, 2022
03a16ca
Update geodata_address.py
Jan 14, 2022
36e08b7
Update test_filter_constraint.glm
Jan 14, 2022
6e1080d
Update geodata_census.py
Jan 14, 2022
8ef9275
Update geodata_distance.py
Jan 14, 2022
29838d3
Update geodata_elevation.py
Jan 14, 2022
e107cdc
Update geodata_powerline.py
Jan 14, 2022
00fcf67
Update geodata_utility.py
Jan 14, 2022
9d938d5
Update geodata_vegetation.py
Jan 14, 2022
abaead4
Merge branch 'develop-fix-geodata-vegetation' into develop-user-manual
Jan 14, 2022
8c92c97
Update gridlabd.glm
Mar 14, 2022
66d5d3d
Update Makefile.am
Mar 14, 2022
1e1daef
Update gridlabd.glm
Mar 14, 2022
00d85f6
Merge branch 'develop' into develop-user-manual
Mar 14, 2022
996e8ee
Update Makefile.mk
Mar 14, 2022
352d837
Update Makefile.mk
Mar 14, 2022
0e63d47
Merge branch 'develop' into develop-user-manual
dchassin Apr 15, 2022
6cfd068
Update Makefile.am
dchassin Apr 15, 2022
4c363d8
Update Makefile.am
dchassin Apr 15, 2022
6e81960
Update Makefile.am
dchassin Apr 15, 2022
37ccbcd
Merge branch 'develop' into develop-user-manual
May 2, 2022
d45b41b
Merge branch 'develop' into pr/862
May 11, 2022
5851a80
Delete 4 - Tariff_design 2.md
May 11, 2022
43c3c27
Update 2 - Preface.md
May 11, 2022
708bf3c
Update 1 - Contents.md
May 11, 2022
cdd28c6
Update 1 - Contents.md
May 11, 2022
3f609eb
Update user manual
May 11, 2022
8f4229f
Update TOC
May 11, 2022
8b46ef5
Update TOC
May 11, 2022
e89b990
Update TOC
May 11, 2022
9e4873c
Update TOC
May 11, 2022
385efd9
Merge branch 'develop' into develop-user-manual
Jul 13, 2022
f133cb1
Add python tutorial
dchassin Aug 6, 2022
129e15f
Merge branch 'develop' into develop-user-manual
dchassin Aug 7, 2022
3627d73
Update session 7
dchassin Aug 7, 2022
99d25c3
Add test_config.glm
dchassin Aug 14, 2022
c7121e8
Add test_modify.glm
dchassin Aug 14, 2022
501aad7
Update csv-table2glm-library.py
dchassin Aug 14, 2022
4799ed8
Add test_library.glm
dchassin Aug 14, 2022
9e8c177
Add test_object.glm
dchassin Aug 14, 2022
13b6764
Update test_object.glm
dchassin Aug 14, 2022
ace4d38
Add test_weather.glm
dchassin Aug 14, 2022
64d83fc
Create session8.ipynb
dchassin Aug 14, 2022
102e94c
Merge branch 'develop' into develop-user-manual
Mar 10, 2023
cb8cf97
Update library.csv
Apr 3, 2023
bd5a61a
Merge branch 'develop' into develop-user-manual
aivanova5 Apr 12, 2023
4311ce0
Update Makefile.am
aivanova5 Apr 13, 2023
ba746d5
Update configure.ac
dchassin Apr 15, 2023
ec52ec5
Update develop.yml
dchassin Apr 15, 2023
cd95835
Update develop.yml
dchassin Apr 15, 2023
184e13b
Merge branch 'develop-user-manual' of https://github.com/slacgismo/gr…
dchassin Apr 15, 2023
509cd06
Update develop.yml
dchassin Apr 15, 2023
44bfdc8
Update Makefile.am
dchassin Apr 15, 2023
9a8f39d
Update Makefile.am
dchassin Apr 15, 2023
09ad250
Update develop.yml
dchassin Apr 15, 2023
7b160a0
Update develop.yml
dchassin Apr 15, 2023
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
11 changes: 9 additions & 2 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,27 @@ jobs:
steps:
- uses: actions/checkout@v2

# this is to fix GIT not liking owner of the checkout dir
# this is to fix GIT not liking owner of the checkout dir
- name: Set ownership
run: |
chown -R $(id -u):$(id -g) $PWD

- name: Update pip
run: python3 -m pip install --upgrade pip

- name: install gridlabd
run: |
autoreconf -isf
./configure
make system
make -j$(($(nproc)*3)) system

- name: Install openfido
run: curl -sL https://raw.githubusercontent.com/openfido/cli/main/install.sh | bash

- name: Validate build
run: |
gridlabd -D keep_progress=TRUE -T 0 --validate -D github_actions=yes || ( utilities/save_validation_errors ; false )

- name: Upload artifacts on failure
uses: actions/upload-artifact@v2
if: failure()
Expand Down
9 changes: 6 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,10 @@ troubleshooting-html:
@(cd $(top_srcdir) ; gawk -f utilities/troubleshooting.awk */*.cpp > $(top_srcdir)/documents/html/troubleshooting/index.html )

documents/gridlabd.pdf: documents/gridlabd.glm
(cd documents ; gridlabd gridlabd.glm)
pandoc -V geometry:landscape documents/gridlabd.md -o documents/gridlabd.pdf
(cd documents ; $(DESTDIR)$(bindir)/gridlabd gridlabd.glm | echo "WARNING: unable to update documents/gridlabd.pdf")
test -f documents/gridlabd.md && pandoc -V geometry:landscape documents/gridlabd.md -o documents/gridlabd.pdf

docs: $(docs_targets)
docs: $(docs_targets) # documents/gridlabd.pdf

docs_toc:
utilities/regen_toc >'docs/User manual/0 - Cover/1 - Contents.md'
4 changes: 4 additions & 0 deletions cloud/websites/tutorials.gridlabd.us/library.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
User Tutorials
user/quickstart,GridLAB-D Quickstart,0
user/samplemodels,Accessing Sample Models,0
user/weatherdata,Getting weather data,0
user/loadmodels,Creating load models,0

Developer Tutorials
developer/session1,Introduction,27
Expand Down
18 changes: 9 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,9 @@ if echo "$host_os" | grep '^linux' >/dev/null; then
fi

if test ! -d "$BINDIR/pkgenv/include/python*"; then
ln -s /usr/local/bin/python${PYEXE}-config $BINDIR/pkgenv/bin/python3-config
ln -s /usr/local/lib/*${PYEXE}* $BINDIR/pkgenv/lib
ln -s /usr/local/include/python${PYEXE} $BINDIR/pkgenv/include
ln -sF /usr/local/bin/python${PYEXE}-config $BINDIR/pkgenv/bin/python3-config
ln -sF /usr/local/lib/*${PYEXE}* $BINDIR/pkgenv/lib
ln -sF /usr/local/include/python${PYEXE} $BINDIR/pkgenv/include
fi

else
Expand All @@ -637,9 +637,9 @@ elif echo "$host_os" | grep '^darwin' >/dev/null; then
# Add Intel Mac-specific configuration here
/usr/local/bin/python$PYEXE -m venv "$BINDIR/pkgenv"

ln -s /usr/local/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/bin/python$PYEXE-config $BINDIR/pkgenv/bin/python3-config
ln -s /usr/local/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/include/python$PYEXE $BINDIR/pkgenv/include
ln -s /usr/local/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/lib/*${PYEXE}* $BINDIR/pkgenv/lib
ln -sF /usr/local/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/bin/python$PYEXE-config $BINDIR/pkgenv/bin/python3-config
ln -sF /usr/local/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/include/python$PYEXE $BINDIR/pkgenv/include
ln -sF /usr/local/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/lib/*${PYEXE}* $BINDIR/pkgenv/lib

$PYDIR/python3 -m ensurepip --upgrade
$PYDIR/python3 -m pip install matplotlib Pillow pandas numpy networkx pytz pysolar PyGithub scikit-learn xlrd boto3
Expand All @@ -651,9 +651,9 @@ elif echo "$host_os" | grep '^darwin' >/dev/null; then
# Add arm64 Mac-specific configuration here
/opt/homebrew/bin/python$PYEXE -m venv "$BINDIR/pkgenv"

ln -s /opt/homebrew/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/bin/python$PYEXE-config $BINDIR/pkgenv/bin/python3-config
ln -s /opt/homebrew/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/include/python$PYEXE $BINDIR/pkgenv/include
ln -s /opt/homebrew/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/lib/*${PYEXE}* $BINDIR/pkgenv/lib
ln -sF /opt/homebrew/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/bin/python$PYEXE-config $BINDIR/pkgenv/bin/python3-config
ln -sF /opt/homebrew/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/include/python$PYEXE $BINDIR/pkgenv/include
ln -sF /opt/homebrew/opt/python@$PYEXE/Frameworks/Python.framework/Versions/$PYEXE/lib/*${PYEXE}* $BINDIR/pkgenv/lib

$PYDIR/python3 -m ensurepip --upgrade
$PYDIR/python3 -m pip install matplotlib Pillow pandas numpy networkx pytz pysolar PyGithub scikit-learn xlrd boto3
Expand Down
3 changes: 3 additions & 0 deletions converters/autotest/test_config.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MY_INT,1
MY_FLOAT,1.2
MY_STRING,test string
10 changes: 10 additions & 0 deletions converters/autotest/test_config.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifexist ../test_config.csv
#define DIR=..
#endif

#convert -i ${DIR:-.}/test_config.csv -o test_config_opt.glm -f csv-config -t glm-config
#include "test_config_opt.glm"

#ifexist ../test_config_opt.glm
#on_exit 0 diff ../test_config_opt.glm test_config_opt.glm >gridlabd.diff
#endif
3 changes: 3 additions & 0 deletions converters/autotest/test_config_opt.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define MY_INT=1
#define MY_FLOAT=1.2
#define MY_STRING=test string
3 changes: 3 additions & 0 deletions converters/autotest/test_library.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class,name,value1,value2
test,item1,1.2,3.4
test,item2,5.6,7.8
15 changes: 15 additions & 0 deletions converters/autotest/test_library.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifexist ../test_library.csv
#define DIR=..
#endif

class test {
double value1;
double value2;
}

#convert -i ${DIR:-.}/test_library.csv -o test_library_opt.glm -f csv-table -t glm-library
#include "test_library_opt.glm"

#ifexist ../test_library_opt.glm
#on_exit 0 diff -I '^//' ../test_library_opt.glm test_library_opt.glm >gridlabd.diff
#endif
13 changes: 13 additions & 0 deletions converters/autotest/test_library_opt.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// generated by csv-table2glm-library/convert('./test_library.csv','test_library_opt.glm',{})
object test
{
name "item1";
value1 "1.2";
value2 "3.4";
}
object test
{
name "item2";
value1 "5.6";
value2 "7.8";
}
4 changes: 4 additions & 0 deletions converters/autotest/test_modify.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
load1.phases,ABC
load1.nominal_voltage,120 V
load1.constant_power_A,10
load1.constant_power_B,8
14 changes: 14 additions & 0 deletions converters/autotest/test_modify.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module powerflow;
object load {
name load1;
}
#ifexist ../test_modify.csv
#define DIR=..
#endif

#convert -i ${DIR:-.}/test_modify.csv -o test_modify_opt.glm -f csv-modify -t glm-modify
#include "test_modify_opt.glm"

#ifexist ../test_modify_opt.glm
#on_exit 0 diff ../test_modify_opt.glm test_modify_opt.glm >gridlabd.diff
#endif
4 changes: 4 additions & 0 deletions converters/autotest/test_modify_opt.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
modify load1.phases "ABC";
modify load1.nominal_voltage "120 V";
modify load1.constant_power_A "10";
modify load1.constant_power_B "8";
3 changes: 3 additions & 0 deletions converters/autotest/test_object.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name,value1,value2
item1,1.2,3.4
item2,5.6,7.8
15 changes: 15 additions & 0 deletions converters/autotest/test_object.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifexist ../test_object.csv
#define DIR=..
#endif

class test {
double value1;
double value2;
}

#convert -i ${DIR:-.}/test_object.csv -o test_object_opt.glm -f csv-table -t glm-object class=test
#include "test_object_opt.glm"

#ifexist ../test_object_opt.glm
#on_exit 0 diff -I '^//' ../test_object_opt.glm test_object_opt.glm >gridlabd.diff
#endif
11 changes: 11 additions & 0 deletions converters/autotest/test_object_opt.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// /usr/local/opt/gridlabd/4.3.1-220814-develop_user_manual/share/gridlabd/csv-table2glm-object.py ./test_object.csv test_object_opt.glm {}
object test {
name "item1";
value1 1.2;
value2 3.4;
}
object test {
name "item2";
value1 5.6;
value2 7.8;
}
22 changes: 22 additions & 0 deletions converters/autotest/test_weather.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
timestamp,temperature
2022-01-01 00:00:00 PST,+44.422
2022-01-01 01:00:00 PST,+42.262
2022-01-01 02:00:00 PST,+42.442
2022-01-01 03:00:00 PST,+42.622
2022-01-01 04:00:00 PST,+44.602
2022-01-01 05:00:00 PST,+41.002
2022-01-01 06:00:00 PST,+42.802
2022-01-01 08:00:00 PST,+41.002
2022-01-01 09:00:00 PST,+44.602
2022-01-01 10:00:00 PST,+46.402
2022-01-01 11:00:00 PST,+50.002
2022-01-01 12:00:00 PST,+57.202
2022-01-01 13:00:00 PST,+64.402
2022-01-01 17:00:00 PST,+62.602
2022-01-01 18:00:00 PST,+53.602
2022-01-01 19:00:00 PST,+51.802
2022-01-01 20:00:00 PST,+48.202
2022-01-01 21:00:00 PST,+46.402
2022-01-01 22:00:00 PST,+44.602
2022-01-01 23:00:00 PST,+42.802
2022-01-02 00:00:00 PST,+44.602
18 changes: 18 additions & 0 deletions converters/autotest/test_weather.glm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
clock {
timezone "PST+8PDT";
starttime "2022-01-01 00:00:00 PST";
stoptime "2022-01-02 00:00:00 PST";
}
#weather get CA-Twentynine_Palms.tmy3
#input "CA-Twentynine_Palms.tmy3"
module tape { csv_header_type NAME; }
object recorder {
parent ${FIND class=climate};
file test_weather.csv;
interval -1;
property temperature;
}

#ifexist ../test_weather.csv
#on_exit 0 diff ../test_weather.csv test_weather.csv > gridlabd.diff
#endif
1 change: 1 addition & 0 deletions converters/csv-table2glm-library.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class specified, which must be a class defined in the module specified.
for id, data in table.iterrows():
if 'class' in data.keys():
oclass = data['class']
del data['class']
elif 'class' in options.keys():
oclass = options['class']
else:
Expand Down
2 changes: 1 addition & 1 deletion converters/csv-table2glm-object.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ def convert (input_name, output_name=None, options={} ) :
if not key in ["module","class"]:
glm.write(f"\t{key} \"{value}\";\n")
glm.write("}\n")
glm.close()
glm.close()
1 change: 1 addition & 0 deletions docs/Developer/Class/Create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO
1 change: 1 addition & 0 deletions docs/Developer/Module/Create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO
99 changes: 99 additions & 0 deletions docs/Developer/Validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[[/Develop/Validation]] - Validation Guide

GridLAB-D validation subsystem is designed to detect code and modeling errors, and identify unexpected changes in the outputs from simulations. Validation is run as part of the build automation. In addition the `--validate` option can be used to run validation tests locally.

The validation system scan the source tree for all folders named `autotest`. In any autotest folders, all the files name `test_*.glm` are processed as follows:

1. A subfolder is created using the GLM file's base name

2. The GLM files is copied to the subfolder.

3. The GLM file is run with the command line `gridlabd BASENAME.glm --redirect=all OPTIONS` where OPTIONS are all the options given after the `--validate` command line option.

4. The exit status of the simulation is interpreted as follows

- If the BASENAME includes the string `_err`, then the exit code must be positive and less than 128 for the validation test to pass, i.e., an error occurred.

- If the BASENAME includes the string `_exc`, then the exit code must be strictly less than zero or greater than 128, i.e., an exception occurred.

- If the BASENAME includes the string `_opt`, then the exit status is ignored.

- Otherwise, the exit status must be exactly zero, i.e., the simulation completed normally.

A report of the validation test results is written to the file `validation.txt`. Progress followed by a summary is output to the screen.

## Frequently used options

There are a few very useful command line that be used *before* the `--validate` option.

- `-T COUNT` or `--threadcount COUNT`: This options enable parallel processing of the validation tests. The count `0` indicates the validation system should try to use the maximum number of available processors. A positive number may be given to indicate the exact number of processors to use. This can reduce the time needed to perform validate tests.

- `-W FOLDER`: This options is used to limit in which folder the search for `autotest` folders is performed. This is useful to perform quick tests of only particular parts of the entire `gridlabd` system.

- `-D keep_progress=TRUE`: This option prevent overwrite of previous progress output. This is useful when performing automated builds where the progress output needs to be preserved.

# Validation Conventions

Validation test emerge from two primary activities. The first is code development, during test cases are identified to ensure that the code works as intended. The second is from issues identified by users, when test cases are used to exemplify a problem or scenario that might not work as expected.

A number of conventions have evolved in validation testing as a result of these activites.

## Use simple models

Some tests need to use very complex models, but most tests should be as simple as possible.

## Use fast tests

Minimize the testing time. There is no need to run a 1 year simulation when a 1 day simulation will suffice.

## Test for edge cases and invalid inputs

Don't just test for what works. Also test for what unusual and what doesn't work. Make sure you test for strange cases that give unintuitive results, and for bad inputs such out of range values, incompatible units, or utter nonsense. Be creative.

## Check the results

Autotests should use `assert` object or `#on_exit` macros to verify that the results are correct. Asserts can be used to check values during a simulation, and `#on_exit` can be used to check after completion.

The most common `assert` is simple to very that a value does not go outside a reasonable range, e.g.,

~~~
object house
{
object assert
{
target "air_temperature";
relation "inside";
lower 60;
upper 90;
};
}
~~~

which causes the simulation to fail if the target value goes outside the specified range.

The most common use of the `#on_exit` macro is to compare an output file to a reference output file, e.g.,

~~~
#define OUTPUT=${modelname/.glm/.csv}
module tape
{
csv_header_type NAME;
}
module residential;
object house
{
object recorder
{
file ${OUTPUT};
};
}
#ifexist "../${OUTPUT}"
#on_exit 0 diff -w ../${OUTPUT} ${OUTPUT}
#endif
~~~

which causes the simulation to fail is the recorder output differs from the one provided in the parent autotest folder. This reference file is automatically generated by the simulation when it is run from the parent folder, so the developer must remember to create and update it whenever the code or model changes in a significant way.

# Automation artifacts

GridLAB-D's automated build system runs validation every time the code is updated. If the validation test fails, an artifact file is created that can be downloaded. The artifact file will contain the autotest folder contents created by the validation tests that failed. These can be examined to determine the cause of the validation test failure.
4 changes: 4 additions & 0 deletions docs/GLM/Directive/Dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ dump interval filename;
The `dump` directive causes the dump file `filename` to be generated at the `interval` times.

If the filename starts with a dash, then the output is sent to stdout in `GLM` format. Adding the extension after the dash causes the specified format to use generated (i.e., `glm` or `json`).

# See also

* [[/Global/Filesave_options]]
Loading