Skip to content

Adapt PSDM to parse simonaMarkovLoad JSON models#1473

Open
PhilippSchmelter wants to merge 25 commits intodevfrom
ps/#1472-markovBased
Open

Adapt PSDM to parse simonaMarkovLoad JSON models#1473
PhilippSchmelter wants to merge 25 commits intodevfrom
ps/#1472-markovBased

Conversation

@PhilippSchmelter
Copy link
Contributor

@PhilippSchmelter PhilippSchmelter commented Nov 10, 2025

Closes #1472

@PhilippSchmelter PhilippSchmelter self-assigned this Nov 10, 2025
@PhilippSchmelter PhilippSchmelter added the enhancement New feature or request label Nov 10, 2025
@PhilippSchmelter PhilippSchmelter marked this pull request as ready for review January 6, 2026 09:29
Copy link
Member

@staudtMarius staudtMarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some first comments. But we should talk about the source again. With the current implementation we split the markov power source into two source classes, while the other power sources are implemented with one class.

Two more things from my side:

  • Could you add more javadocs and comments in the code to improve the readability of the code?
  • Could you add some information for readTheDocs?

public BufferedReader initReader(Path filePath) throws FileNotFoundException {
InputStream inputStream = openInputStream(filePath);
return new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8), 16384);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? I think this could be removed, since we are only using the input stream to read in the JSON file.

}

default TimeModel parseTimeModel(JsonNode timeNode) {
int bucketCount = requireInt(timeNode, "bucket_count");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think naming the method acquiere... or extract... would be better.


JsonNode gmmNode = parametersNode.path("gmm");
Parameters.GmmParameters gmm =
gmmNode.isMissingNode() || gmmNode.isNull() || gmmNode.size() == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be improved by using gmmNode.isEmpty().

*/
private static final String LOAD_PROFILE_TIME_SERIES =
"lpts_(?<profile>[a-zA-Z]{1,11}[0-9]{0,3})";
"(?:lpts|markov)_(?<profile>[a-zA-Z]{1,11}[0-9]{0,3})";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could lead to a problem if someone is using lpts_h0.csv and markov_h0.json. We should add some explanation to the docs that the profile names need to be unique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Markov-based PowerValueSource

2 participants