Skip to content

[Bug] Mixed inputformat error #8

@NMoksnes

Description

@NMoksnes
Error in sys.excepthook:
Traceback (most recent call last):
  File "c:\nobackup\anaconda3\envs\snakemake\lib\site-packages\otoole\cli.py", line 282, in exception_handler
    print("{}: {}".format(exception_type.__name__, exception.message))
AttributeError: 'AmplyError' object has no attribute 'message'

Original exception was:
Traceback (most recent call last):
  File "c:\nobackup\anaconda3\envs\snakemake\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\nobackup\anaconda3\envs\snakemake\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Nobackup\Anaconda3\envs\snakemake\Scripts\otoole.exe\__main__.py", line 7, in <module>
  File "c:\nobackup\anaconda3\envs\snakemake\lib\site-packages\otoole\cli.py", line 287, in main
    args.func(args)
  File "c:\nobackup\anaconda3\envs\snakemake\lib\site-packages\otoole\cli.py", line 112, in result_matrix
    input_data, _ = ReadDatafile().read(args.input_datafile)
  File "c:\nobackup\anaconda3\envs\snakemake\lib\site-packages\otoole\read_strategies.py", line 212, in read
    amply_datafile = self.read_in_datafile(filepath, config)
  File "c:\nobackup\anaconda3\envs\snakemake\lib\site-packages\otoole\read_strategies.py", line 229, in read_in_datafile
    datafile_parser.load_file(datafile)
  File "c:\nobackup\anaconda3\envs\snakemake\lib\site-packages\amply\amply.py", line 817, in load_file
    self.load_string(f.read())
  File "c:\nobackup\anaconda3\envs\snakemake\lib\site-packages\amply\amply.py", line 806, in load_string
    obj.eval(self)
  File "c:\nobackup\anaconda3\envs\snakemake\lib\site-packages\amply\amply.py", line 305, in eval
    self.name, self.tokens
amply.amply.AmplyError: Error in number of records of Peakdemand when reading ['param', 'Peakdemand', 'default', 1.0, [<SliceRecord: ('Kenya', '*', '*')>, <TabularRecord: {'TRLV_1_0': {2016.0: 0.0, 2017.0: 0.0, 2018.0: 0.0, 2019.0: 0.035503748, 2020.0: 0.073847796, 2021.0: 0.115202562, 2022.0: 0.159747552, 2023.0: 0.207671818, 2024.0: 0.259174428, 2025.0: 0.314464973, 2026.0: 0.373764082, 2027.0: 0.437303976, 2028.0: 0.437303976, 2029.0: 0.437303976, 2030.0: 0.437303976, 2031.0: 0.437303976, 2032.0: 0.437303976, 2033.0: 0.437303976, 2034.0: 0.437303976, 2035.0: 0.437303976, 2036.0: 0.437303976, 2037.0: 0.437303976, 2038.0: 0.437303976, 2039.0: 0.437303976, 2040.0: 0.437303976}, 'TRLV_2_0': {2016.0: 0.0, 2017.0: 0.0, 2018.0: 0.0, 2019.0: 0.031715426, 2020.0: 0.065968085, 2021.0: 0.102910213, 2022.0: 0.142702162, 2023.0: 0.18551281, 2024.0: 0.231519987, 2025.0: 0.280910918, 2026.0: 0.333882691, 2027.0: 0.390642748, 2028.0: 0.390642748, 2029.0: 0.390642748, 2030.0: 0.390642748, 2031.0: 0.390642748, 2032.0: 0.390642748, 2033.0: 0.390642748, 2034.0: 0.390642748, 2035.0: 0.390642748, 2036.0: 0.390642748, 2037.0: 0.390642748, 2038.0: 0.390642748, 2039.0: 0.390642748, 2040.0: 0.390642748}, 'TRLV_3_0': {2016.0: 0.0, 2017.0: 0.0, 2018.0: 0.0, 2019.0: 0.03760931, 2020.0: 0.078227364, 2021.0: 0.122034688, 2022.0: 0.169221434, 2023.0: 0.219987865, 2024.0: 0.274544855, 2025.0: 0.333114424, 2026.0: 0.395930287, 2027.0: 0.463238436, 2028.0: 0.463238436, 2029.0: 0.463238436, 2030.0: 0.463238436, 2031.0: 0.463238436, 2032.0: 0.463238436, 2033.0: 0.463238436, 2034.0: 0.463238436, 2035.0: 0.463238436, 2036.0: 0.463238436, 2037.0: 0.463238436, 2038.0: 0.463238436, 2039.0: 0.463238436, 2040.0: 0.463238436}, 'TRLV_4_0': {2016.0: 0.0, 2017.0: 0.0, 2018.0: 0.0, 2019.0: 0.052990896, 2020.0: 0.110221063, 2021.0: 0.171944858, 2022.0: 0.238430203, 2023.0: 0.309959264, 2024.0: 0.386829161, 2025.0: 0.469352715, 2026.0: 0.557859227, 2027.0: 0.652695296, 2028.0: 0.652695296, 2029.0: 0.652695296, 2030.0: 0.652695296, 2031.0: 0.652695296, 2032.0: 0.652695296, 2033.0: 0.652695296, 2034.0: 0.652695296, 2035.0: 0.652695296, 2036.0: 0.652695296, 2037.0: 0.652695296, 2038.0: 0.652695296, 2039.0: 0.652695296, 2040.0: 0.652695296}, 'TRLV_5_0': {2016.0: 0.0, 2017.0: 0.0, 2018.0: 0.0, 2019.0: 0.034974676, 2020.0: 0.072747325, 2021.0: 0.113485828, 2022.0: 0.157367014, 2023.0: 0.204577119, 2024.0: 0.255312244, 2025.0: 0.309778856, 2026.0: 0.368194298, 2027.0: 0.430787328, 2028.0: 0.430787328, 2029.0: 0.430787328, 2030.0: 0.430787328, 2031.0: 0.430787328, 2032.0: 0.430787328, 2033.0: 0.430787328, 2034.0: 0.430787328, 2035.0: 0.430787328, 2036.0: 0.430787328, 2037.0: 0.430787328, 2038.0: 0.430787328, 2039.0: 0.430787328, 2040.0: 0.430787328}, 'TRLV_6_0': {2016.0: 0.0, 2017.0: 0.0, 2018.0: 0.0, 2019.0: 0.037202401, 2020.0: 0.077380994, 2021.0: 0.12071435, 2022.0: 0.167390565, 2023.0: 0.217607735, 2024.0: 0.271574453, 2025.0: 0.329510336, 2026.0: 0.391646571, 2027.0: 0.458226488, 2028.0: 0.458226488, 2029.0: 0.458226488, 2030.0: 0.458226488, 2031.0: 0.458226488, 2032.0: 0.458226488, 2033.0: 0.458226488, 2034.0: 0.458226488, 2035.0: 0.458226488, 2036.0: 0.458226488, 2037.0: 0.458226488, 2038.0: 0.458226488, 2039.0: 0.458226488, 2040.0: 0.458226488}, 'TRLV_7_0': {2016.0: 0.0, 2017.0: 0.0, 2018.0: 0.0, 2019.0: 0.023055127, 2020.0: 0.047954664, 2021.0: 0.074809276, 2022.0: 0.103735529, 2023.0: 0.134856188, 2024.0: 0.168300522, 2025.0: 0.204204634, 2026.0: 0.242711793, 2027.0: 0.283972798, 2028.0: 0.283972798, 2029.0: 0.283972798, 2030.0: 0.283972798, 2031.0: 0.283972798, 2032.0: 0.283972798, 2033.0: 0.283972798, 2034.0: 0.283972798, 2035.0: 0.283972798, 2036.0: 0.283972798, 2037.0: 0.283972798, 2038.0: 0.283972798, 2039.0: 0.283972798, 2040.0: 0.283972798}, 'TRLV_8_0': {2016.0: 0.0, 2017.0: 0.0, 2018.0: 0.0, 2019.0: 0.029656132, 2020.0: 0.061684755, 2021.0: 0.096228218, 2022.0: 0.133436462, 2023.0: 0.1734674, 2024.0: 0.216487316, 2025.0: 0.262671276, 2026.0: 0.312203574, 2027.0: 0.365278182, 2028.0: 0.365278182, 2029.0: 0.365278182, 2030.0: 0.365278182, 2031.0: 0.365278182, 2032.0: 0.365278182, 2033.0: 0.365278182, 2034.0: 0.365278182, 2035.0: 0.365278182, 2036.0: 0.365278182, 2037.0: 0.365278182, 2038.0: 0.365278182, 2039.0: 0.365278182, 2040.0: 0.365278182}, 'TRLV_9_0': {2016.0: 0.0, 2017.0: 0.0, 2018.0: 0.0, 2019.0: 0.040579304, 2020.0: 0.084404952, 2021.0: 0.131671725, 2022.0: 0.182584792, 2023.0: 0.23736023, 2024.0: 0.296225567, 2025.0: 0.359420354, 2026.0: 0.427196764, 2027.0: 0.499820214, 2028.0: 0.499820214, 2029.0: 0.499820214, 2030.0: 0.499820214, 2031.0: 0.499820214, 2032.0: 0.499820214, 2033.0: 0.499820214, 2034.0: 0.499820214, 2035.0: 0.499820214, 2036.0: 0.499820214, 2037.0: 0.499820214, 2038.0: 0.499820214, 2039.0: 0.499820214, 2040.0: 0.499820214}}>]]

I have mixed input formats in my datafile for parameters. Some inputs are in matrix form and some are in "long" format.
I get the following Error message:
amply.amply.AmplyError: Error in number of records of Peakdemand
when reading the first parameter which is in matrix format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions