Skip to content

Commit

Permalink
Style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihantao committed Oct 29, 2021
1 parent 8a07517 commit 080ccac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
6 changes: 3 additions & 3 deletions andes/system.py
Expand Up @@ -17,9 +17,10 @@
import os
import sys
import inspect
import dill
import time

import dill

from collections import OrderedDict
from typing import Dict, Tuple, Union, Optional

Expand All @@ -37,9 +38,8 @@
from andes.io.streaming import Streaming

from andes.shared import np, jac_names, dilled_vars
from andes.shared import matrix, spmatrix, sparse, Pool
from andes.shared import matrix, spmatrix, sparse, Pool, Process

from multiprocess import Process

logger = logging.getLogger(__name__)
dill.settings['recurse'] = True
Expand Down
2 changes: 1 addition & 1 deletion andes/utils/__init__.py
@@ -1,4 +1,4 @@
from andes.utils import paths # NOQA
from andes.utils import sympy # NOQA
from andes.utils.paths import get_case # NOQA
from andes.utils import snapshot # NOQA
from andes.utils import snapshot # NOQA
15 changes: 13 additions & 2 deletions tests/test_snapshot.py
@@ -1,8 +1,12 @@
"""
Test ANDES snapshot based on dill.
"""

import os
import andes
import unittest
import numpy as np

import unittest
import andes
from andes.utils.snapshot import save_ss, load_ss


Expand All @@ -12,6 +16,10 @@ class TestSnapshot(unittest.TestCase):
"""

def test_save_ss(self):
"""
Test saving a snapshot.
"""

ss = andes.run(andes.get_case("kundur/kundur_full.xlsx"))
ss.TDS.config.tf = 2
ss.TDS.run()
Expand All @@ -20,6 +28,9 @@ def test_save_ss(self):
os.remove('test_ss.pkl')

def load_ss(self):
"""
Test loading a snapshot and continuing the simulation.
"""

# load a snapshot
test_dir = os.path.dirname(__file__)
Expand Down

0 comments on commit 080ccac

Please sign in to comment.