Skip to content

Commit 0494140

Browse files
committed
Update examples, changelog, README for version 0.14.0
SVN ref: git-svn-id: https://svn.code.sf.net/p/electricdss/code/trunk@3723 d8739450-1e93-4ef4-a0af-c327d92816ff
1 parent a269244 commit 0494140

File tree

6 files changed

+27
-22
lines changed

6 files changed

+27
-22
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This library exposes the OpenDSS/OpenDSS-PM v9+ engine in a plain C interface th
1212
Through the other projects under DSS-Extensions, DSS C-API enables projects to use the OpenDSS in multiple platforms (Windows, Linux, macOS) across multiple architectures (Intel x86, x86-64, ARM32, and ARM64, including Apple's M1 and M2). Most of the features added to this based library is shared across all other projects. If you need support for a language not listed below, please open a new issue (either here or in https://github.com/dss-extensions/dss-extensions/issues) and we will evaluate that language.
1313

1414
<p align="center">
15-
<img alt="Overview of related repositories" src="https://raw.githubusercontent.com/dss-extensions/dss_capi/master/docs/images/repomap.png" width=600>
15+
<img alt="Overview of related repositories" src="https://raw.githubusercontent.com/dss-extensions/dss-extensions/main/images/repomap.png" width=600>
1616
</p>
1717

1818
If you are looking for the bindings to other languages:
@@ -23,11 +23,11 @@ If you are looking for the bindings to other languages:
2323
- [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 with the API of the official OpenDSS COM classes.
2424
- [dss.hpp](https://dss-extensions.org/dss_capi/): header-only library for C++, also hosped in this repository (`include/` directory). Allows using DSS C-API more comfortably from C++, abstract away memory management and low-level details such as API conventions of the DSS C-API library. Currently uses Eigen and fmt.
2525

26-
Version 0.13.x is based on OpenDSS revision 3619 (exactly OpenDSS v9.6.1.2), with many extra/custom features.
26+
Version 0.14.x is based on OpenDSS revision 3723 (exactly OpenDSS v9.8.0.1), with many extra/custom features.
2727

2828
**For the source-code of a specific version, check the Git tags or the Releases page.**
2929

30-
While the main objective of COM compatibility has been reached, this is still a work-in-progress and is subject to changes. Especially, there are planned changes targeting version 0.14, which will become v1.0 when we consider it ready.
30+
While the main objective of COM compatibility has been reached, this is still a work-in-progress and is subject to changes. Especially, there are planned changes targeting version 1.0.
3131

3232
Instead of using extra numeric parameters as in the official DDLL interface ("OpenDSSDirect" or "DCSL"), each original COM property is exposed as a pair of functions. For example, the load kVA property is exposed as:
3333

@@ -46,7 +46,7 @@ Since 2019-03-05, the `dss_capi` repository contains all the Pascal code used to
4646

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

49-
- 2023-12-13 / version 0.14.0b1: Beta release for 0.14.0. Lots of changes and bugfixes, see the changelog.
49+
- 2024-02-09 / version 0.14.0: Lots of changes and bugfixes, see the changelog.
5050
- 2023-06-27 / version 0.13.4: Bugfix release (CapControl), incremental improvements. See the changelog or release page for details.
5151
- 2023-06-11 / version 0.13.3: Bugfix release for some components (notably Capacitor, Reactor, UPFC).
5252
- 2023-05-24 / version 0.13.2: Minor release, includes updates to JSON exports, some more error-checking, internal code refactoring, header updates, and minor ports from the official OpenDSS.

docs/changelog.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
- i18n complements
1616
- drop the `ctx_` prefix for most functions, leave the DSSContext API as the default version. We plan to drop the current single-instance API, but we can add a header with inline C functions, prefixed, for easier migration.
1717

18+
# Versions 0.14.x
1819

19-
## Version 0.14.0
20+
## Version 0.14.0 (2024-02-09)
2021

21-
Starting on this version, we will call DSS C-API and related projects AltDSS, an alternative implementation of OpenDSS, to make it more clear that this is not supported by EPRI and many extra features are not present in the official OpenDSS. Watch the DSS-Extensions org on GitHub for more announcements soon, including some support for the official implementation (still Windows-only at the moment).
22+
Starting on this version, we will call DSS C-API and related projects AltDSS, an alternative implementation of OpenDSS, to make it more clear that this is not supported by EPRI and many extra features are not present in the official OpenDSS. Watch the DSS-Extensions org on GitHub for more announcements soon, including some support for the official implementation (still Windows-only at the moment). The name change **does not** mean compatibility or other aspects are expected to change, the project will still follow the basic guidelines of compatibility that have been followed since 2018.
2223

23-
This version should match OpenDSS v9.7.1.1 (SVN r3646). Remember to check the compatibility flags and [Known differences](https://github.com/dss-extensions/dss_capi/blob/master/docs/known_differences.md). Other recent SVN commits, up to r3717 (dated 2023-12-11), either do not update code or are not relevant for the implementation on AltDSS/DSS C-API.
24+
This version should match OpenDSS v9.8.0.1 (SVN r3723). Remember to check the compatibility flags and [Known differences](https://github.com/dss-extensions/dss_capi/blob/master/docs/known_differences.md).
2425

2526
- Another large internal (Pascal) code refactoring step and general clean-up. Check the commits for details, too many to list. A last step is under progress and will be merged in the next major release.
2627

@@ -39,6 +40,7 @@ This version should match OpenDSS v9.7.1.1 (SVN r3646). Remember to check the co
3940
- **Introduce "Setter" flags.** These are flags used to tweak how the property update is done. Notably,`AvoidFullRecalc` (some other flags are only using by the engine, internally): some specific properties like `Load.kW` can be updated both directly through a DSS script (or Text interface), or through the dedicated Loads API in any of the specific language bindings of the many APIs. The dedicated API does not force a YPrim update and full load model recalculation.
4041
- When using this flag `AvoidFullRecalc` in the Obj/Batch APIs, the behavior will follow the dedicated Loads API.
4142
- Other flags include `ImplicitSizes` and `AllowAllConductors`. Both are currently used for enabling some of the JSON Schema functionally.
43+
- For batch operations, `SkipNA` was introduced to allow handling scenarios with non-uniform data.
4244
- The relevant API functions were updated to include an extra function argument with the setter flags.
4345
- Is this `AvoidFullRecalc` the same as `SkipSideEffects` compat flag? **No.** `AvoidFullRecalc` is still valid and by design (including some behavior listed in OpenDSS docs), whereas `SkipSideEffects` is potentially unintended behavior.
4446

@@ -52,12 +54,15 @@ This version should match OpenDSS v9.7.1.1 (SVN r3646). Remember to check the co
5254

5355
- **New** Alt and Obj families of functions. A new family of functions was added to allow most legacy API operations and new functionality directly on objects and batches, instead of relying on "active..." idiom. A new package, **AltDSS-Python**, will be published to illustrate the new approach. Since the engine is shared, users can mix both approach (e.g. use AltDSS-Python and OpenDSSDirect.py in the same script).
5456

55-
- Batch/API: allow using batches with simple functions that return float64/int32 for each object.
57+
- Batch/API:
58+
- Allow using batches with simple functions that return float64/int32 for each object.
59+
- Allow using `INT32_MAX` and `NaN` for missing values, which can be skipped with the `SetterFlags_SkipNA` flag. Sooner or later, there should a better alternative, but this can be useful in the time being.
5660

5761
- Headers:
5862
- Remove `stdint_compat.h`. This was only required for very old or non-standard compiler like MSVC 2008. Users that require that can still source the file from older releases or get similar files from other sources.
5963
- Include `stddef.h` when building as C code.
6064
- Mark `CktElement_Get_IsIsolated` with `(API Extension)`
65+
- Add more `const` qualifiers. Especially useful for the new Rust and Golang bindings.
6166

6267
- Specific bug fixes:
6368
- AutoTrans: fix `DumpProperties`, readd `bank` property (unused internally).
@@ -81,6 +86,7 @@ This version should match OpenDSS v9.7.1.1 (SVN r3646). Remember to check the co
8186

8287
- Misc:
8388
- Error handling: add a few numeric checks, and check for errors in more places during solution algorithms. The changes should help finding issues earlier and/or more easily.
89+
- Check for null pointers (usually missing circuit solution) in a few more places.
8490
- Properties/capitalization: adjust capitalization of nearly all property names. Use lowercase for description keys (help strings). *Feedback on the capitalization is welcome.* As a reminder, OpenDSS is case-insensitive, but other other are not. Providing a better internal representation of the properties will help other tools to use the internal names without extra work (no need for each tool to adjust capitalization), and it doesn't affect the DSS engine itself nor compatibility with the upstream OpenDSS.
8591
- Obj/API: introduce `ExtraClassIDs` to get some special lists.
8692
- Classic to Obj/Alt API bridge: add many `*_Get_Pointer` functions (e.g. `CktElement_Get_Pointer`, `Loads_Get_Pointer`). These functions return a pointer that can be used in the Obj API. This should enable an easier migration from the classic API, or allow users to use the Obj API to complement the classic API where the latter is lacking.

examples/ctx_openmp.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ int main(void)
6161
}
6262

6363
// Get total for the register "Zone Losses kWh" (index 12)
64-
int32_t count[2] = {0, 0};
64+
int32_t dims[4] = {0, 0, 0, 0};
6565
double *totals = NULL;
6666
ctx_Meters_Get_First(ctx);
67-
ctx_Meters_Get_Totals(ctx, &totals, count);
67+
ctx_Meters_Get_Totals(ctx, &totals, dims);
6868
kWh_losses += totals[12];
6969
DSS_Dispose_PDouble(&totals);
7070
}

examples/minimal_classic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ int main(void)
66
{
77
// For numVoltages, first `int` is the current count,
88
// the second `int` is the allocated capacity.
9-
int numVoltages[2] = {0, 0};
9+
int numVoltages[4] = {0, 0, 0, 0};
1010
double *voltages = NULL;
1111
int numNodes;
1212
int i;

examples/minimal_gr.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ int main(void)
88
double** data_PDouble;
99
int32_t** data_PInteger;
1010
int8_t** data_PByte;
11-
int32_t* count_PPAnsiChar;
12-
int32_t* count_PDouble;
13-
int32_t* count_PInteger;
14-
int32_t* count_PByte;
11+
int32_t* dims_PPAnsiChar;
12+
int32_t* dims_PDouble;
13+
int32_t* dims_PInteger;
14+
int32_t* dims_PByte;
1515

1616
double* voltages;
1717
int numNodes;
@@ -23,24 +23,24 @@ int main(void)
2323
&data_PDouble,
2424
&data_PInteger,
2525
&data_PByte,
26-
&count_PPAnsiChar,
27-
&count_PDouble,
28-
&count_PInteger,
29-
&count_PByte
26+
&dims_PPAnsiChar,
27+
&dims_PDouble,
28+
&dims_PInteger,
29+
&dims_PByte
3030
);
3131

3232
Text_Set_Command("compile master.dss");
3333
Solution_Solve();
3434
Circuit_Get_AllBusVolts_GR();
3535

3636
// The result for Circuit_Get_AllBusVolts is now in
37-
// dataPtr_PDouble[0] and countPtr_PDouble
37+
// dataPtr_PDouble[0] and dims_PDouble
3838

3939
// Copy just the pointer for convenience, the GR mechanism
4040
// in Pascal is responsible for the allocated memory.
4141
voltages = data_PDouble[0];
4242

43-
numNodes = count_PDouble[0]/2;
43+
numNodes = dims_PDouble[0]/2;
4444
if (numNodes == 0)
4545
{
4646
return -1;

src/Executive/ExecHelper.pas

-1
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,6 @@ procedure ShowAnyHelp(DSS: TDSSContext; cmd: ArrayOfString; const opt: String; c
935935
begin
936936
if Length(opt) < 1 then
937937
begin
938-
Writeln('if Length(opt) < 1 then');
939938
lst := TStringList.Create;
940939
for i := 0 to High(cmd) do
941940
lst.Add(PadRight(cmd[i], colwidth));

0 commit comments

Comments
 (0)