Skip to content

Calculate averaged congestion and save file on server#92

Merged
rouille merged 3 commits intodevelopfrom
calculate_averaged_cong
Mar 27, 2020
Merged

Calculate averaged congestion and save file on server#92
rouille merged 3 commits intodevelopfrom
calculate_averaged_cong

Conversation

@rouille
Copy link
Copy Markdown
Collaborator

@rouille rouille commented Mar 27, 2020

Purpose

A data frame enclosing the averaged CONGU and CONGL for each branch is written as a pickle file on the server In addition to the other usual simulation outputs.

What is the code doing

It calculates the averaged congestion via the calculate_averaged_congestion in the postreise.extract.extract_data module. The function is then used to save the returned data frame as pickle file.

Tests have been written in postreise.extract.tests.test_extract_data.

Time estimate

Should be fairly quick. A 24h test scenario could be created, ran and extracted to make sure the file is correctly saved.

Note

The procedure that download/load in the Scenario object this file still need to be implemented in PowerSimData.

@rouille rouille added congestion data collection Output data (generation, capacity factor, ...) labels Mar 27, 2020
@rouille rouille requested review from danielolsen and kasparm March 27, 2020 14:51
congl = pd.DataFrame({'bart': [1, 2, 3, 4], 'lisa': [10, 11, 12, 13]})
congu = pd.DataFrame({'bart': [21, 22, 23, 24], 'lisa': [30, 31, 32, 33]})
mean_cong = calculate_averaged_congestion(congl, congu)
assert np.array_equal(mean_cong.values, [[ 2.5, 22.5], [11.5, 31.5]])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PEP8 [[ 2.5, 22.5] -> [[2.5, 22.5]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I thought it was the missing line at the end of file! Ok. I fix it, interactive rebase and force push.

Copy link
Copy Markdown
Contributor

@danielolsen danielolsen left a comment

Choose a reason for hiding this comment

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

There's the tiniest PEP8 bug, other than that it looks good to go.

@rouille rouille force-pushed the calculate_averaged_cong branch from 78afd74 to 96960de Compare March 27, 2020 16:30
@rouille rouille changed the title Calculate averaged congestion and save output corresponding file on server Calculate averaged congestion and save file on server Mar 27, 2020
@rouille rouille merged commit 3fd373c into develop Mar 27, 2020
@rouille rouille deleted the calculate_averaged_cong branch March 27, 2020 18:27
@ahurli ahurli mentioned this pull request Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data collection Output data (generation, capacity factor, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants