Пример #1
0
def satfunc_reverse_main(args) -> None:
    """For command line utility for CSV to Eclipse"""
    if args.verbose:
        logging.basicConfig(level=logging.INFO)
    satfunc_df = pd.read_csv(args.csvfile)
    logger.info("Parsed %s", args.csvfile)
    inc_string = df2ecl(satfunc_df, keywords=args.keywords)
    common.write_inc_stdout_file(inc_string, args.output)
Пример #2
0
def equil_reverse_main(args) -> None:
    """Entry-point for module, for command line utility for CSV to Eclipse"""
    logger = getLogger_ecl2csv(  # pylint: disable=redefined-outer-name
        __name__, vars(args))
    equil_df = pd.read_csv(args.csvfile)
    logger.info("Parsed %s", args.csvfile)
    inc_string = df2ecl(equil_df, keywords=args.keywords)
    common.write_inc_stdout_file(inc_string, args.output)
Пример #3
0
def test_write_inc_file(tmpdir):
    """Test that we can write include files to files."""
    tmpdir.chdir()
    string = "PORO\n0\n/"
    common.write_inc_stdout_file(string, "poro.inc")
    assert Path("poro.inc").read_text() == string
Пример #4
0
def test_write_inc_stdout(capsys):
    """Test that we can write include files to stdout."""
    string = "PORO\n0\n/"
    common.write_inc_stdout_file(string, common.MAGIC_STDOUT)
    assert string in capsys.readouterr().out