{
  "appeals": 1,
  "budgets": {
    "baseline_limit_s": 600,
    "verification_timeout_s": 600,
    "worker": {
      "max_completion_tokens": 96000,
      "max_turns": 60,
      "max_wall_seconds": 1500.0,
      "prompt_token_budget": 160000
    }
  },
  "issue": "Trouble using the `default_experiment`\nI have ran into two issues trying to set the `default_experiment` using the `DefaultExperiment` class.\r\n\r\nFirst, the xml parser is throwing an error regarding serializing the floats specified in the start/stop time fields, as such:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3.8/xml/etree/ElementTree.py\", line 1076, in _escape_attrib\r\n    if \"&\" in text:\r\nTypeError: argument of type 'float' is not iterable\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \".../bin/pythonfmu\", line 8, in <module>\r\n    sys.exit(cli_main())\r\n  File \"...lib/python3.8/site-packages/pythonfmu/__main__.py\", line 55, in cli_main\r\n    execute(**options)\r\n  File \"...lib/python3.8/site-packages/pythonfmu/builder.py\", line 184, in build_FMU\r\n    xml_str = parseString(tostring(xml, \"UTF-8\"))\r\n  File \"/usr/lib/python3.8/xml/etree/ElementTree.py\", line 1133, in tostring\r\n    ElementTree(element).write(stream, encoding,\r\n  File \"/usr/lib/python3.8/xml/etree/ElementTree.py\", line 772, in write\r\n    serialize(write, self._root, qnames, namespaces,\r\n  File \"/usr/lib/python3.8/xml/etree/ElementTree.py\", line 937, in _serialize_xml\r\n    _serialize_xml(write, e, qnames, None,\r\n  File \"/usr/lib/python3.8/xml/etree/ElementTree.py\", line 930, in _serialize_xml\r\n    v = _escape_attrib(v)\r\n  File \"/usr/lib/python3.8/xml/etree/ElementTree.py\", line 1099, in _escape_attrib\r\n    _raise_serialization_error(text)\r\n  File \"/usr/lib/python3.8/xml/etree/ElementTree.py\", line 1053, in _raise_serialization_error\r\n    raise TypeError(\r\nTypeError: cannot serialize 0.0 (type float)\r\n\r\n```\r\n\r\nI was able to at least hackily work around this by simply casting the times as strings in the constructor like so:\r\n\r\n```\r\nclass MyFMU(Fmi2Slave):\r\n    ...\r\n    default_experiment = DefaultExperiment(start_time=str(0.), stop_time=str(1.))\r\n    ...\r\n```\r\n\r\nBut after this it seems the model description validator (when trying to run the fmu through `fmpy` at least) doesn't like the default experiment field being there:\r\n```\r\n---------------------------------------------------------------------------\r\nException                                 Traceback (most recent call last)\r\nCell In [29], line 1\r\n----> 1 simulate_custom_input()\r\n\r\nCell In [28], line 21, in simulate_custom_input(show_plot)\r\n     18 step_size = 1e-3\r\n     20 # read the model description\r\n---> 21 model_description = read_model_description(fmu_filename)\r\n     23 # collect the value references\r\n     24 vrs = {}\r\n\r\nFile .../lib/python3.8/site-packages/fmpy/model_description.py:415, in read_model_description(filename, validate, validate_variable_names, validate_model_structure)\r\n    413         for entry in schema.error_log:\r\n    414             message += \"\\n%s (line %d, column %d): %s\" % (entry.level_name, entry.line, entry.column, entry.message)\r\n--> 415         raise Exception(message)\r\n    417 modelDescription = ModelDescription()\r\n    418 _copy_attributes(root, modelDescription, ['fmiVersion', 'guid', 'modelName', 'description', 'generationTool',\r\n    419                                           'generationDateAndTime', 'variableNamingConvention'])\r\n\r\nException: Failed to validate modelDescription.xml:\r\nERROR (line 38, column 0): Element 'DefaultExperiment': This element is not expected.\r\n```\r\n\r\nWould this be an xml serialization issue on this end, or a validation issue on `fmpy`'s end?\r\n\r\nThanks!\r\n\r\nbtw this is a really nice package! :+1: ",
  "source": {
    "image": "docker.io/swerebenchv2/ntnu-ihb-pythonfmu:158-ae50251",
    "platform": "linux/amd64",
    "python": "python",
    "setup": [
      "python -c 'import base64; from pathlib import Path; Path('\"'\"'/tmp/receipts-ntnu-ihb__pythonfmu-158-test.patch'\"'\"').write_bytes(base64.b64decode('\"'\"'ZGlmZiAtLWdpdCBhL3B5dGhvbmZtdS90ZXN0cy9zbGF2ZXMvcHl0aG9uc2xhdmVfcmVhZF9maWxlLnB5IGIvcHl0aG9uZm11L3Rlc3RzL3NsYXZlcy9weXRob25zbGF2ZV9yZWFkX2Z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zdmJ1aWxkZXIgaW1wb3J0IEZtdUJ1aWxkZXIKKworCitkZWYgdGVzdF9kZWZhdWx0X2V4cGVyaW1lbnQodG1wX3BhdGgpOgorICAgIGZtcHkgPSBweXRlc3QuaW1wb3J0b3Jza2lwKAorICAgICAgICAiZm1weSIsIHJlYXNvbj0iZm1weSBpcyBub3QgYXZhaWxhYmxlIGZvciB0ZXN0aW5nIHRoZSBwcm9kdWNlZCBGTVUiCisgICAgKQorCisgICAgc2NyaXB0X2ZpbGUgPSBQYXRoKF9fZmlsZV9fKS5wYXJlbnQgLyAic2xhdmVzL3B5dGhvbnNsYXZlX3JlYWRfZmlsZS5weSIKKyAgICBwcm9qZWN0X2ZpbGUgPSBQYXRoKF9fZmlsZV9fKS5wYXJlbnQgLyAiZGF0YS9oZWxsby50eHQiCisgICAgZm11ID0gRm11QnVpbGRlci5idWlsZF9GTVUoc2NyaXB0X2ZpbGUsIHByb2plY3RfZmlsZXM9W3Byb2plY3RfZmlsZV0sIGRlc3Q9dG1wX3BhdGgsIG5lZWRzRXhlY3V0aW9uVG9vbD0iZmFsc2UiKQorICAgIGFzc2VydCBmbXUuZXhpc3RzKCkKKworICAgIG1vZGVsX2Rlc2NyaXB0aW9uID0gZm1weS5yZWFkX21vZGVsX2Rlc2NyaXB0aW9uKGZtdSkK'\"'\"'))'",
      "git apply /tmp/receipts-ntnu-ihb__pythonfmu-158-test.patch"
    ],
    "workdir": "/PythonFMU"
  },
  "spec_paths": [
    "pythonfmu/tests/slaves/pythonslave_read_file.py",
    "pythonfmu/tests/test_default_experiment.py"
  ],
  "spec_tests": [
    "pythonfmu/tests/test_default_experiment.py::test_default_experiment"
  ],
  "suite_scope": "--no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning pythonfmu/tests/slaves/pythonslave_read_file.py pythonfmu/tests/test_default_experiment.py"
}
