Esempio n. 1
0
def test_pitch_clip():
    """
    Pitch in this time range goes from 48.62 to 158.41.  dpa_clip.json
    has been modified so the solarheat pitch range is from 55 .. 153.
    Make sure the model still runs with no interpolation error.
    """
    mdl = ThermalModel('dpa', start='2012:001', stop='2012:007',
                       model_spec=abs_path('dpa_clip.json'))
    try:
        mdl._get_cmd_states()
    except:
        pytest.skip('No commanded states access - '
                    'cannot run DPA model with real states')

    mdl.make()
    mdl.calc()
Esempio n. 2
0
def test_dpa_remove_pow():
    mdl = ThermalModel('dpa', start='2019:001:12:00:00', stop='2019:007:12:00:00',
                       model_spec=abs_path('dpa_remove_pow.json'))
    mdl._get_cmd_states()

    mdl.make()
    mdl.calc()
    dpa = mdl.comp['1dpamzt']
    reffile = abs_path('dpa_remove_pow.npz')
    if not os.path.exists(reffile):
        print('Writing reference file', reffile)
        np.savez(reffile, times=mdl.times, dvals=dpa.dvals,
                 mvals=dpa.mvals)

    regr = np.load(reffile)
    assert np.allclose(mdl.times, regr['times'])
    assert np.allclose(dpa.dvals, regr['dvals'])
    assert np.allclose(dpa.mvals, regr['mvals'])
Esempio n. 3
0
def test_pitch_clip():
    """Pitch in this time range goes from 48.62 to 158.41.  dpa_clip.json
    has been modified so the solarheat pitch range is from 55 .. 153.
    Make sure the model still runs with no interpolation error.

    Parameters
    ----------

    Returns
    -------

    """
    mdl = ThermalModel('dpa', start='2012:001:12:00:00', stop='2012:007:12:00:00',
                       model_spec=abs_path('dpa_clip.json'))
    mdl._get_cmd_states()

    mdl.make()
    mdl.calc()
Esempio n. 4
0
def test_dpa_remove_pow():
    mdl = ThermalModel('dpa', start='2012:001', stop='2012:007',
                       model_spec=abs_path('dpa_remove_pow.json'))
    # Check that cmd_states database can be read.  Skip if not, probably
    # running test on a platform without access.
    try:
        mdl._get_cmd_states()
    except:
        pytest.skip('No commanded states access - '
                    'cannot run DPA model with real states')

    mdl.make()
    mdl.calc()
    dpa = mdl.comp['1dpamzt']
    reffile = abs_path('dpa_remove_pow.npz')
    if not os.path.exists(reffile):
        print('Writing reference file', reffile)
        np.savez(reffile, times=mdl.times, dvals=dpa.dvals,
                 mvals=dpa.mvals)

    regr = np.load(reffile)
    assert np.allclose(mdl.times, regr['times'])
    assert np.allclose(dpa.dvals, regr['dvals'])
    assert np.allclose(dpa.mvals, regr['mvals'])