f967bd87424bbc50f475d5959994a5743ae2af0e,src/pudl/convert/epacems_to_parquet.py,,epacems_to_parquet,#Any#Any#Any#Any#Any#Any#Any#,168

Before Change


    data_path = pathlib.Path(datapkg_dir, "data")
    // double check that all of the years you are asking for are actually in
    _verify_cems_args(data_path, epacems_years, epacems_states)
    for file in data_path.iterdir():
        if "epacems" in file.name:
            df_name = file.name[:file.name.find(".")]
            year = int(df_name[25:29])
            state = df_name[30:].upper()
            // only convert the years and states that you actually want
            if year in epacems_years and state in epacems_states:
                df = pd.read_csv(
                    file, dtype=in_types, parse_dates=["operating_datetime_utc"]
                ).assign(year=year)
                logger.info(
                    f"Converted {len(df)} records for {year} and {state}."
                )
                pq.write_to_dataset(
                    pa.Table.from_pandas(
                        df, preserve_index=False, schema=schema),
                    root_path=str(out_dir), partition_cols=list(partition_cols),
                    compression=compression)


def parse_command_line(argv):
    
    Parse command line arguments. See the -h option.

After Change


    if not out_dir:
        raise AssertionError("Required output directory not specified.")
    out_dir = pudl.load.metadata.prep_directory(out_dir, clobber=clobber)
    data_dir = pathlib.Path(datapkg_path).parent / "data"

    // Verify that all the requested data files are present:
    epacems_years = list(epacems_years)
    epacems_years.sort()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: catalyst-cooperative/pudl
Commit Name: f967bd87424bbc50f475d5959994a5743ae2af0e
Time: 2019-12-28
Author: zane.selvans@catalyst.coop
File Name: src/pudl/convert/epacems_to_parquet.py
Class Name:
Method Name: epacems_to_parquet


Project Name: matplotlib/matplotlib
Commit Name: 66348a9259bc034d0f6b21cfb554f8b2f0af94b0
Time: 2018-03-23
Author: anntzer.lee@gmail.com
File Name: tools/triage_tests.py
Class Name:
Method Name: find_failing_tests


Project Name: pantsbuild/pants
Commit Name: da0989f9f00cf2a9eca58410a721d23a1fdf72bb
Time: 2019-08-19
Author: ericarellano@me.com
File Name: contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_checkstyle.py
Class Name: CheckstyleTest
Method Name: build_checker_wheel