MCPcopy Create free account
hub / github.com/algorithmicsuperintelligence/openevolve / _import_program

Function _import_program

examples/sldbench/evaluator.py:138–145  ·  view source on GitHub ↗

Imports a Python module from a given file path.

(program_path: str)

Source from the content-addressed store, hash-verified

136
137
138def _import_program(program_path: str):
139 """Imports a Python module from a given file path."""
140 spec = importlib.util.spec_from_file_location("scaling_law_module", program_path)
141 if spec is None or spec.loader is None:
142 raise ImportError(f"Could not create module spec from path: {program_path}")
143 module = importlib.util.module_from_spec(spec)
144 spec.loader.exec_module(module)
145 return module
146
147def resolve_task_name(program_path: str) -> str:
148 """Infers the task name from environment variables or the file path."""

Callers 1

evaluate_coreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected