create_omv_tests.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/env python3
  2. """
  3. Create OMV test templates
  4. File: create_omv_tests.py
  5. Copyright 2023 Ankur Sinha
  6. Author: Ankur Sinha <sanjay DOT ankur AT gmail DOT com>
  7. """
  8. import textwrap
  9. # cellnames = ["HL23PV", "HL23PYR", "HL23SST", "HL23VIP"]
  10. cellnames = ["HL23PYR", "HL23SST", "HL23VIP"]
  11. sim_engines = {
  12. "jnmleden": "jNeuroML_EDEN",
  13. "jnmlnetpyne": "jNeuroML_NetPyNE",
  14. "jnmlneuron": "jNeuroML_NEURON",
  15. }
  16. for cell in cellnames:
  17. cell_suffix = cell[4:].lower()
  18. for fn, eng in sim_engines.items():
  19. omv_filename = f".test.{cell_suffix}.{fn}.omt"
  20. print(f"Creating {omv_filename}")
  21. with open(omv_filename, 'w') as omv_file:
  22. print(textwrap.dedent(f"""
  23. # Script for running automated tests on OSB, see https://github.com/OpenSourceBrain/osb-model-validation
  24. target: LEMS_{cell}_sim.xml
  25. engine: {eng}
  26. mep: tests/.test.{cell_suffix}.mep
  27. experiments:
  28. step{cell[4:]}:
  29. observables:
  30. spike times:
  31. file:
  32. path: {cell}_net.dat
  33. columns: [0,1]
  34. scaling: [1000,1000]
  35. spike detection:
  36. method: threshold
  37. """),
  38. file=omv_file)
  39. # tolerance: 0.0