KTH-dESA / GEOSeMOSYS

GIS module for OSeMOSYS
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Input data files to run_datafile.py #1

Closed NMoksnes closed 4 years ago

NMoksnes commented 4 years ago

@willu47 I didn't understand exactly how you wanted the input data folder to be called? Was it from the command line as an argument?

willu47 commented 4 years ago

If you develop a command line interface (CLI) using argparse then you'd want to pass in the path to the folder of CSV files, and potentially another configuration file.

In any case, you will also want a main function which the CLI calls which takes the filepath as an argument.

NMoksnes commented 4 years ago

Ok. Then I understand. Thanks!

willu47 commented 4 years ago

Something like:

def main(filepath, configuration_file):
    """Generate spatially disaggregated values"""
    # Read input data
    with open(os.path.join(filepath, "data.csv", 'r') as datafile:
        data = datafile.readlines()
    <...>