コード例 #1
0
import pytest
import utilities as ut
import os

ut.ErrorFile(error_name="swr_error.txt")

script_ws = os.path.dirname(os.path.abspath(__file__))
valid_output_ws = os.path.join(script_ws,
                               "OWHM_Example_Problems/test-out-true-swr")
owhm2_output_ws = os.path.join(script_ws, "OWHM_Example_Problems/test-out-swr")

list_file_names = []
head_file_names = []
budget_file_names = []

for extension in ut.CommonExtentions.list_file:
    list_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.budget_file:
    budget_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.head_file:
    head_file_names += ut.get_file_names(valid_output_ws, filter=extension)

setup = [(lf, owhm2_output_ws, valid_output_ws) for lf in list_file_names]
setup2 = [(bf, owhm2_output_ws, valid_output_ws) for bf in budget_file_names]
setup3 = [(hf, owhm2_output_ws, valid_output_ws) for hf in head_file_names]


@pytest.mark.parametrize("name,owhm2_ws,valid_ws", setup)
def test_list_budgets(name, owhm2_ws, valid_ws):
コード例 #2
0
import pytest
import utilities as ut
import os


ut.ErrorFile(error_name="fmp_error.txt")

script_ws = os.path.dirname(os.path.abspath(__file__))
valid_output_ws = os.path.join(script_ws, "OWHM_Example_Problems/FMP2_Example_Model/test-out-true")
owhm2_output_ws = os.path.join(script_ws, "OWHM_Example_Problems/FMP2_Example_Model/test-out")

list_file_names = []
head_file_names = []
budget_file_names = []
fds_file_names = []
fbd_file_names = []

for extension in ut.CommonExtentions.list_file:
    list_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.budget_file:
    budget_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.head_file:
    head_file_names += ut.get_file_names(valid_output_ws, filter=extension)

setup = [(lf, owhm2_output_ws, valid_output_ws) for lf in list_file_names]
setup2 = [(bf, owhm2_output_ws, valid_output_ws) for bf in budget_file_names]
setup3 = [(hf, owhm2_output_ws, valid_output_ws) for hf in head_file_names]
setup4 = [(fd, owhm2_output_ws, valid_output_ws) for fd in fds_file_names]
setup5 = [(fb, owhm2_output_ws, valid_output_ws) for fb in fbd_file_names]
コード例 #3
0
import pytest
import utilities as ut
import os


ut.ErrorFile(error_name="lgr_pcg_error.txt")

script_ws = os.path.dirname(os.path.abspath(__file__))
valid_output_ws = os.path.join(script_ws, "OWHM_Example_Problems/test-run-owhm-lgr/fmp-lgr-lpf-test-out-true")
owhm2_output_ws = os.path.join(script_ws, "OWHM_Example_Problems/test-run-owhm-lgr/fmp-lgr-lpf-test-out")

list_file_names = []
head_file_names = []
budget_file_names = []

for extension in ut.CommonExtentions.list_file:
    list_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.budget_file:
    budget_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.head_file:
    head_file_names += ut.get_file_names(valid_output_ws, filter=extension)


setup = [(lf, owhm2_output_ws, valid_output_ws) for lf in list_file_names]
setup2 = [(bf, owhm2_output_ws, valid_output_ws) for bf in budget_file_names]
setup3 = [(hf, owhm2_output_ws, valid_output_ws) for hf in head_file_names]


@pytest.mark.parametrize("name,owhm2_ws,valid_ws", setup)
コード例 #4
0
import pytest
import utilities as ut
import os

ut.ErrorFile(error_name="mfowhm_error.txt")

script_ws = os.path.dirname(os.path.abspath(__file__))
valid_output_ws = os.path.join(
    script_ws, "OWHM_Example_Problems/OWHM_v1_vs_v2/v1/Output")
owhm2_output_ws = os.path.join(
    script_ws, "OWHM_Example_Problems/OWHM_v1_vs_v2/v2/Output")
secondary_ws = os.path.join(script_ws,
                            "OWHM_Example_Problems/OWHM_v1_vs_v2/v1")

list_file_names = []
head_file_names = []
budget_file_names = []
fds_out_file_names = []
fb_details_file_names = []

for extension in ut.CommonExtentions.list_file:
    list_file_names += ut.get_file_names(valid_output_ws, filter=extension)

budget_file_names += ut.get_file_names(valid_output_ws,
                                       filter="OWHM_EX1_CBC.out")

head_file_names += ut.get_file_names(valid_output_ws, filter="Head_save.out")

fds_out_file_names += ut.get_file_names(secondary_ws, filter='fds.out')

fb_details_file_names += ut.get_file_names(secondary_ws,
コード例 #5
0
import pytest
import utilities as ut
import os

ut.ErrorFile(error_name="rip_error.txt")

script_ws = os.path.dirname(os.path.abspath(__file__))
valid_output_ws = os.path.join(script_ws, "OWHM_Example_Problems/test-out-true-rip")
owhm2_output_ws = os.path.join(script_ws, "OWHM_Example_Problems/test-out-rip")

list_file_names = []
head_file_names = []
budget_file_names = []

for extension in ut.CommonExtentions.list_file:
    list_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.budget_file:
    budget_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.head_file:
    head_file_names += ut.get_file_names(valid_output_ws, filter=extension)

setup = [(lf, owhm2_output_ws, valid_output_ws) for lf in list_file_names]
setup2 = [(bf, owhm2_output_ws, valid_output_ws) for bf in budget_file_names]
setup3 = [(hf, owhm2_output_ws, valid_output_ws) for hf in head_file_names]


@pytest.mark.parametrize("name,owhm2_ws,valid_ws", setup)
def test_list_budget(name, owhm2_ws, valid_ws):
    ut.ErrorFile.write_model_name(name)
コード例 #6
0
import pytest
import utilities as ut
import os


ut.ErrorFile(error_name="mf2005_error.txt")

script_ws = os.path.dirname(os.path.abspath(__file__))
valid_output_ws = os.path.join(script_ws, "OWHM_Example_Problems/test-out-true")
owhm2_output_ws = os.path.join(script_ws, "OWHM_Example_Problems/test-out")

list_file_names = []
head_file_names = []
budget_file_names = []

for extension in ut.CommonExtentions.list_file:
    list_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.budget_file:
    budget_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.head_file:
    head_file_names += ut.get_file_names(valid_output_ws, filter=extension)
head_file_names += ut.get_file_names(valid_output_ws, filter=".out")

setup = [(lf, owhm2_output_ws, valid_output_ws) for lf in list_file_names]
setup2 = [(bf, owhm2_output_ws, valid_output_ws) for bf in budget_file_names]
setup3 = [(hf, owhm2_output_ws, valid_output_ws) for hf in head_file_names]


@pytest.mark.parametrize("name,owhm2_ws,valid_ws", setup)
コード例 #7
0
import pytest
import utilities as ut
import os

ut.ErrorFile(error_name="lgr_nwt_error.txt")

script_ws = os.path.dirname(os.path.abspath(__file__))
valid_output_ws = os.path.join(
    script_ws,
    "OWHM_Example_Problems/test-run-owhm-lgr/fmp-lgr-nwt-test-out-true")
owhm2_output_ws = os.path.join(
    script_ws, "OWHM_Example_Problems/test-run-owhm-lgr/fmp-lgr-nwt-test-out")

list_file_names = []
head_file_names = []
budget_file_names = []
fds_file_names = []
fbd_file_names = []

for extension in ut.CommonExtentions.list_file:
    list_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.budget_file:
    budget_file_names += ut.get_file_names(valid_output_ws, filter=extension)

for extension in ut.CommonExtentions.head_file:
    head_file_names += ut.get_file_names(valid_output_ws, filter=extension)

setup = [(lf, owhm2_output_ws, valid_output_ws) for lf in list_file_names]
setup2 = [(bf, owhm2_output_ws, valid_output_ws) for bf in budget_file_names]
setup3 = [(hf, owhm2_output_ws, valid_output_ws) for hf in head_file_names]