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

v0.12.x mega-merge #109

Merged
merged 27 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e2c2a9e
Squashed changes, docs pending
PMeira Mar 7, 2022
6ce62e6
Builds: cross-compile to macOS ARM64/aarch64, including GitHub Actions.
PMeira Mar 8, 2022
a754bba
User-models: update headers; remove from legacy models; consolidate f…
PMeira Mar 9, 2022
ece66dd
Add COMHelp with instructions on where to download it.
PMeira Mar 16, 2022
5777b58
Properties/RegControl.PTPhase: fix corner case in hybrid enum
PMeira Mar 17, 2022
6ea25cd
AlwaysResetYPrimInvalid: Reduce number of bits to fit in a int32 (and…
PMeira Mar 17, 2022
9b7d7b4
A few microoptimizations
PMeira Mar 17, 2022
35eed4d
Load, ZIPV model: apply some manual optimizations
PMeira Mar 17, 2022
d909f68
YMatrix_SolveSystem: fix NIL check and tweak params
PMeira Mar 19, 2022
ec0c572
Solution: check for infinites in MaxError
PMeira Mar 22, 2022
b7bebd4
CktElement/API: To match SVN, add CktElement_Set_Variable/CktElement_…
PMeira Mar 22, 2022
a8ea2ed
CIM: port recent changes.
PMeira Mar 22, 2022
d3d1f6b
InvControl(2): remove infinite loop
PMeira Mar 27, 2022
38691b2
API: fix/add invalid state checks.
PMeira Mar 27, 2022
eb8ecff
Spectrum: Fix issue when reading fewer items than specified from CSV.
PMeira Mar 30, 2022
53cd601
ExportCIMXML: port recent changes (from multiple revisions)
PMeira Mar 31, 2022
215c3b1
ExportCIMXML: port a few SVN commits
PMeira Apr 11, 2022
3e55121
Recloser: in `Sample`, check if `MonitoredObj` (`MonitoredElement`) w…
PMeira Apr 11, 2022
ecaae7e
DOScmd: introduce toggle flag and matching functions; default to disa…
PMeira Apr 11, 2022
4388b7d
ReduceAlgs, from SVN: "Checking for bus in the KeepList when reducing…
PMeira Apr 12, 2022
0d7cfb7
Capacitors/API: Fix error in format string
PMeira Apr 13, 2022
5e55d38
Port from SVN: "Fixing issues when using ActiveActor=* within a scrip…
PMeira Apr 14, 2022
c943b2b
ZIP: better error and filename handling
PMeira Apr 15, 2022
d960bd7
ZIP/API: add ZIP_Extract to get the contents of a compressed file
PMeira Apr 20, 2022
166585b
ZIP/API: Add Contains and List, and comments.
PMeira Apr 20, 2022
533b025
PVSystems: Update units in `Irradiance` comments
PMeira Apr 21, 2022
fbe465e
README: Update the basic text and diagrams
PMeira May 2, 2022
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
19 changes: 12 additions & 7 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ jobs:
path: '${{ github.workspace }}/dss_capi/release/*.tar.gz'

build_macos_x64:
name: 'macOS x64'
name: 'macOS x64 and ARM64'
runs-on: macos-latest
env:
KLUSOLVE_URL: 'https://github.com/dss-extensions/klusolve/releases/download/1.0.0a1/klusolvex_1.0.0a1_darwin_x64.tar.gz'
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -88,16 +86,23 @@ jobs:
sudo installer -package /Volumes/fpc-3.2.2.intelarm64-macosx/fpc-3.2.2-intelarm64-macosx.mpkg -target /
- name: 'Download/extract KLUSolve(X)'
run: |
wget "${KLUSOLVE_URL}" -Oklusolve.tar.gz -q
tar zxf klusolve.tar.gz
wget "https://github.com/dss-extensions/klusolve/releases/download/1.0.0a1/klusolvex_1.0.0a1_darwin_x64.tar.gz" -Oklusolve_x64.tar.gz -q
wget "https://github.com/dss-extensions/klusolve/releases/download/1.0.0a1/klusolvex_1.0.0a1_darwin_arm64.tar.gz" -Oklusolve_arm64.tar.gz -q
tar zxf klusolve_x64.tar.gz
tar zxf klusolve_arm64.tar.gz
cp -r klusolvex/lib/* dss_capi/lib/
- name: Build
- name: Build x64
run: |
cd dss_capi
source ./build/make_metadata.sh
./build/build_macos_x64.sh
ls -lR lib

- name: Build ARM64
run: |
cd dss_capi
source ./build/make_metadata.sh
./build/build_macos_arm64.sh
ls -lR lib
- name: 'Upload artifacts'
uses: "actions/upload-artifact@v2"
#if: github.event_name == 'release' && github.event.action == 'created'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ __recovery
*.dproj.local
__history
.vscode
__pycache__
*.out.*
5 changes: 3 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Copyright (c) 2008-2019, Electric Power Research Institute, Inc.
Copyright (c) 2017-2019, Paulo Meira
Copyright (c) 2008-2022, Electric Power Research Institute, Inc.
Copyright (c) 2017-2022, Paulo Meira
Copyright (c) 2018-2022, DSS Extensions contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ If you are looking for the bindings to other languages:
- [DSS Sharp](http://github.com/dss-extensions/dss_sharp/) is available for .NET/C#, also mimics the COM classes, but Windows-only at the moment. Soon it will be possible to use it via COM too.
- [DSS MATLAB](http://github.com/dss-extensions/dss_matlab/) presents multi-platform integration (Windows, Linux, MacOS) with DSS C-API and is also very compatible bastante with the COM classes.

Version 0.10.7, based on OpenDSS revision 2963 (around version OpenDSS 9.1.3.4), with many extra/custom features.
Version 0.12.0dev, based on OpenDSS revision 3363, with many extra/custom features.

**This is the work-in-progress branch, which will become 0.12.0.**
**This is the work-in-progress branch, which will become 0.12.0. For a specific version, check the Git tags.**

While the main objective of COM compatibility has been reach, this is still a work-in-progress and is subject to changes.
*Note that, while the interface with OpenDSS is stable (v7, classic version), the OpenDSS-PM (v8, actor-based parallel machine version) interface is experimental in our builds.* From version 0.10, the v8 interface is a lot more stable than in 0.9.8. Since version 0.10.5, the parallel-machine code from Version 8 is not built for binary releases anymore -- stay tuned for a future unified version.
Expand All @@ -42,7 +42,8 @@ Since 2019-03-05, the `dss_capi` repository contains all the Pascal code used to

See [the changelog](https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/changelog.md) for a detailed list.

- **2020-03-09 / version 0.10.7-1: Includes a fix for some reports which presented corrupted text in version 0.10.7.**
- **2022-02-xx / version 0.12.0: Beta versions of 0.12.0 available. Final 0.12.0 expected in May 2022.**
- 2021-03-09 / version 0.10.7-1: Includes a fix for some reports which presented corrupted text in version 0.10.7.
- 2020-12-28 / version 0.10.7: Maintenance release based on on OpenDSS revision 2963. Includes fixes and new features from the official OpenDSS. [A new document describing the DSS properties](https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/dss_properties.md) was added.
- 2020-07-31 / version 0.10.6: New API extensions, and ported changes from the official OpenDSS codebase. Includes some bugfixes, a new extended validation error messages and new compatibility toggles.
- 2020-03-03 / version 0.10.5: Maintenance release with several minor fixes. Includes changes ported from COM and the official OpenDSS codebase. Version 8 binary releases excluded.
Expand All @@ -61,8 +62,7 @@ See [the changelog](https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/

## Missing features and limitations

- Currently not implemented:
- `DSSEvents` from `DLL/ImplEvents.pas`: seems too dependent on COM.
- Currently not fully implemented:
- Plotting in general

## Extra features
Expand Down Expand Up @@ -141,6 +141,8 @@ Currently most testing/validation is based on [DSS Python](http://github.com/dss

## Roadmap

(Still being updated for 0.12.x)

Besides bug fixes, the main funcionality of this library is mostly done. Notable desirable features that may be implemented are:
- Expose more classes and important methods/properties for all classes
- More and better documentation. We already integrated the help strings from the IDL/COM definition files in the header files.
Expand Down
9 changes: 6 additions & 3 deletions README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Esta biblioteca expõe o motor do OpenDSS/OpenDSS-PM (v7/v8) através de uma interface C plana, que tenta reproduzir a maioria dos métodos COM. De fato, a maior parte do código foi inicialmente derivado dos arquivos da implementação COM. O DLL resultante pode ser usado diretamente ou através de módulos de interface, como o módulo `DSS Python`. DSS Python representa um módulo para linguagem Python que imita a mesma estrutura do módulo COM (como exposto via `win32com` ou `comtypes`), efetivamente nos permitindo alcançar compatilibilidade multi-plataforma a nível de Python. Também há suporte para outras linguagens diversas -- caso tenha interesse numa linguagem não suportada, abra um novo "issue".

<p align="center">
<img alt="Visão geral dos repositórios relacionados" src="https://raw.githubusercontent.com/dss-extensions/dss_capi/master/docs/images/repomap.png" width=600>
<img alt="Visão geral dos repositórios relacionados" src="https://raw.githubusercontent.com/dss-extensions/dss_capi/master/docs/images/repomap_pt.png" width=600>
</p>

Caso procure integração com outras linguagens de programação:
Expand All @@ -18,7 +18,9 @@ Caso procure integração com outras linguagens de programação:
- [DSS Sharp](http://github.com/dss-extensions/dss_sharp/) para .NET/C#, no momento apenas Windows. Em breve também será possível usá-lo via COM.
- [DSS MATLAB](http://github.com/dss-extensions/dss_matlab/) permite integração multi-plataforma (Windows, Linux, MacOS) bastante compatível com o módulo COM, de fato contorna algumas dificuldades de COM.

Versão 0.10.7, baseada no OpenDSS SVN r2963 (em torno do OpenDSS 9.1.3.4), com várias funcionalidades extras.
Versão 0.12.0dev, baseada no OpenDSS revisão (SVN) 3363, com várias funcionalidades customizadas e extras.

**Este branch pode estar em desenvolvimento. Para uma versão específica, consulte os tags do Git do repositório.**

Apesar de o objetivo principal (compatibilidade com COM) ter sido alcançado, este é um sempre um trabalho em andamento.
*Observe que, enquanto a interface clássica (v7 + aprimoramentos) é estável, a interface para o OpenDSS-PM (v8, baseada em atores e execução paralela) ainda é experimental.* A partir da versão 0.10, a interface v8 está bem mais estável que na versão 0.9.8 da DSS C-API. A partir da versão 0.10.5, o código da pasta `Version8` não é mais compilado -- uma nova versão unificada é esperada para uma futura versão.
Expand Down Expand Up @@ -61,7 +63,6 @@ Veja o [registro de alterações (em inglês)](https://github.com/dss-extensions
## Funcionalidades faltantes e limitações

- Ainda não implementados:
- `DSSEvents` de `DLL/ImplEvents.pas`: parece ser muito dependente de COM.
- Gráficos em geral

## Funcionalides extras
Expand Down Expand Up @@ -248,6 +249,8 @@ Atualmente, todos os testes e validação são baseados no [DSS Python](http://g

## Planos

(Ainda sendo atualizados para versão 0.12.x)

Além de correções de problemas, a funcionalidade principal desta biblioteca está pronta. Alguns pontos que pretendemos trabalhar envolvem:
- Expor os principais métodos e propriedades faltantes (não presentes nem mesmo na interface COM), assim como classes.
- Documentação melhor e mais completa. As strings de ajuda dos arquivos de definição IDL/COM já estão reproduzidos nos headers (pasta `include`), mas apenas em inglês.
Expand Down
45 changes: 45 additions & 0 deletions build/build_macos_arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

set -e -x

python3 src/classic_to_ctx.py

export LDFLAGS=-L`pwd`/lib/darwin_arm64/

rm -rf build/units_arm64
mkdir build/units_arm64
fpc -Paarch64 @src/darwin-arm64.cfg -B src/dss_capi.lpr

# Make the lib look in the same folder for KLUSolveX
DSS_CAPI_LIB="lib/darwin_arm64/libdss_capi.dylib"
CURRENT_LIBKLUSOLVE=`otool -L "$DSS_CAPI_LIB" | grep libklusolvex | cut -f 1 -d ' ' | sed $'s/^[ \t]*//'`
NEW_LIBKLUSOLVE="@loader_path/./libklusolvex.dylib"
install_name_tool -change "$CURRENT_LIBKLUSOLVE" "$NEW_LIBKLUSOLVE" "$DSS_CAPI_LIB"
install_name_tool -id "@loader_path/./libdss_capi.dylib" "$DSS_CAPI_LIB"

rm -rf build/units_arm64
mkdir build/units_arm64
fpc -Paarch64 @src/darwin-arm64-dbg.cfg -B src/dss_capid.lpr

# Make the lib look in the same folder for KLUSolveX
DSS_CAPI_LIB="lib/darwin_arm64/libdss_capid.dylib"
CURRENT_LIBKLUSOLVE=`otool -L "$DSS_CAPI_LIB" | grep libklusolvex | cut -f 1 -d ' ' | sed $'s/^[ \t]*//'`
NEW_LIBKLUSOLVE="@loader_path/./libklusolvex.dylib"
install_name_tool -change "$CURRENT_LIBKLUSOLVE" "$NEW_LIBKLUSOLVE" "$DSS_CAPI_LIB"
install_name_tool -id "@loader_path/./libdss_capi.dylib" "$DSS_CAPI_LIB"

mkdir -p release/dss_capi/lib
cp -R lib/darwin_arm64 release/dss_capi/lib/darwin_arm64
cp -R include release/dss_capi/
# cp -R examples release/dss_capi/
cp LICENSE release/dss_capi/
cp OPENDSS_LICENSE release/dss_capi/
if [ -d "klusolvex" ]; then
cp klusolvex/LICENSE release/dss_capi/KLUSOLVE_LICENSE
else
cp ../klusolvex/LICENSE release/dss_capi/KLUSOLVE_LICENSE
fi
cd release
tar zcf "dss_capi_${DSS_CAPI_VERSION}_darwin_arm64.tar.gz" dss_capi
cd ..
rm -rf release/dss_capi
7 changes: 7 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- expose the OpenDSS v8/v9 PM features as possible
- continue work on the plotting and extended reporting API
- see also the GitHub milestone: https://github.com/dss-extensions/dss_capi/milestone/6
- remove `LegacyModels` (older/deprecated models for PVSystem, Storage and related classes)

# Version 0.12

Expand Down Expand Up @@ -53,6 +54,12 @@ This version still maintains basic compatibility with the 0.10.x series of relea

- Drop function aliases: previously deprecated function aliases (`LoadShapes_Set_Sinterval` and `LoadShapes_Get_sInterval`) were removed to simplify the build process. Use `LoadShapes_Set_SInterval` and `LoadShapes_Get_SInterval` instead.
- Monitor headers: From the official OpenDSS, since May 2021, the monitor binary stream doesn't include the header anymore. When porting the change to DSS Extensions, we took the opportunity to rewrite the related code, simplifying it. As such, the implementation in DSS Extensions deviates from the official one. Extra blank chars are not included, and fields should be more consistent. As a recommendation, if your code needs to be compatible with both implementations, trimming the fields should be enough.
- Error messages: most messages are now more specific and, if running a DSS script from files, include the file names and line numbers.
- Spectrum: To reduce overhead during object edits, now required to exist before the object that uses it. This is consistent with most of the other types in OpenDSS.
- New object and batch APIs
- New experimental API for loading scripts/data from ZIP files
- New convenience functions to bulk load commands from the API
- User-models: headers updated, and removed support for user-models in `LegacyModels` mode. `LegacyModels` will be removed in v0.13.

Due to the high number of IO changes, we recommend checking the performance before and after the upgrade to ensure your use case is not affected negatively. If issues are found, please do report.

Expand Down
Binary file modified docs/images/repomap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading