Skip to content

Save MAT-file to be read by MATReader object#76

Merged
rouille merged 4 commits intodevelopfrom
save_grid_mat
Feb 24, 2020
Merged

Save MAT-file to be read by MATReader object#76
rouille merged 4 commits intodevelopfrom
save_grid_mat

Conversation

@rouille
Copy link
Copy Markdown
Collaborator

@rouille rouille commented Feb 24, 2020

This PR applies the following changes:

  • refactor the the carbon analysis and the associated test to account for the new structure of the gencost attribute of the Grid object.
  • copy the input.mat that holds all the information used by the simulation engine in the INPUT_DIR location on the server (see issue Save MAT-file to be read by MATReader object #75).

@rouille rouille added new feature Feature that is currently in progress. grid labels Feb 24, 2020
@rouille rouille added this to the Leap Ahead milestone Feb 24, 2020
@danielolsen
Copy link
Copy Markdown
Contributor

When the matreader branch of powersimdata is checked out (and pip installed if necessary), all tests pass. Some warnings due to deprecated imports in other packages.

PS C:\Users\dolsen\repos\iv\postreise> python -m pytest
============================= test session starts =============================
platform win32 -- Python 3.7.4, pytest-5.3.1, py-1.8.0, pluggy-0.13.1
rootdir: C:\Users\dolsen\repos\iv\postreise
collected 87 items

postreise\analyze\tests\test_carbon.py ....                              [  4%]
postreise\analyze\tests\test_congestion_surplus.py ...                   [  8%]
postreise\analyze\tests\test_curtailment.py ............                 [ 21%]
postreise\analyze\tests\test_helpers.py ....                             [ 26%]
postreise\analyze\tests\test_mwmiles.py ....                             [ 31%]
postreise\analyze\tests\test_statelines.py .....                         [ 36%]
postreise\plot\multi\tests\test_plot_bar.py ..........                   [ 48%]
postreise\plot\multi\tests\test_plot_helpers.py ...............          [ 65%]
postreise\plot\multi\tests\test_plot_pie.py ....                         [ 70%]
postreise\plot\multi\tests\test_plot_shortfall.py .........              [ 80%]
postreise\plot\tests\test_plot_shadowprice.py .........                  [ 90%]
postreise\process\test\test_transfer.py ..                               [ 93%]
postreise\tests\test_mocks.py ......                                     [100%]

============================== warnings summary ===============================
C:\Python37\lib\site-packages\win32\lib\pywintypes.py:2
  C:\Python37\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp, sys, os

C:\Python37\lib\site-packages\jinja2\utils.py:485
  C:\Python37\lib\site-packages\jinja2\utils.py:485: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from collections import MutableMapping

C:\Python37\lib\site-packages\jinja2\runtime.py:318
  C:\Python37\lib\site-packages\jinja2\runtime.py:318: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from collections import Mapping

-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 87 passed, 3 warnings in 3.32s ========================

@rouille
Copy link
Copy Markdown
Collaborator Author

rouille commented Feb 24, 2020

This what I have got after the your commit:

(v1) [~/REM/PostREISE] (save_grid_mat) brdo$ pytest .
================================================================ test session starts ================================================================
platform darwin -- Python 3.6.5, pytest-4.5.0, py-1.8.0, pluggy-0.13.0
rootdir: /Users/brdo/REM/PostREISE
collected 87 items                                                                                                                                  

postreise/analyze/tests/test_carbon.py ....                                                                                                   [  4%]
postreise/analyze/tests/test_congestion_surplus.py ...                                                                                        [  8%]
postreise/analyze/tests/test_curtailment.py ............                                                                                      [ 21%]
postreise/analyze/tests/test_helpers.py ....                                                                                                  [ 26%]
postreise/analyze/tests/test_mwmiles.py ....                                                                                                  [ 31%]
postreise/analyze/tests/test_statelines.py .....                                                                                              [ 36%]
postreise/plot/multi/tests/test_plot_bar.py ..........                                                                                        [ 48%]
postreise/plot/multi/tests/test_plot_helpers.py ...............                                                                               [ 65%]
postreise/plot/multi/tests/test_plot_pie.py ....                                                                                              [ 70%]
postreise/plot/multi/tests/test_plot_shortfall.py .........                                                                                   [ 80%]
postreise/plot/tests/test_plot_shadowprice.py .........                                                                                       [ 90%]
postreise/process/test/test_transfer.py ..                                                                                                    [ 93%]
postreise/tests/test_mocks.py ......                                                                                                          [100%]

============================================================= 87 passed in 3.12 seconds =============================================================

@danielolsen
Copy link
Copy Markdown
Contributor

Seems like in 3.7 they started throwing some warnings so that they could break backward compatibility in 3.8. You're still on 3.6 so they leave you alone. It's like my old VW diesel: it predated the emissions cheating scandal, the rules were looser back then so I'm still grandfathered in.

@rouille
Copy link
Copy Markdown
Collaborator Author

rouille commented Feb 24, 2020

The copy of the file has been tested with a test scenario.

@rouille rouille requested a review from danielolsen February 24, 2020 22:03
@rouille rouille merged commit 8f01b15 into develop Feb 24, 2020
@rouille rouille deleted the save_grid_mat branch February 24, 2020 22:07
@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

new feature Feature that is currently in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants