-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently, data params that are setup in server.py are magically injected into the setup_code.py namespace. This confuses IDEs' static checks (error messages) and makes it harder to understand what's happening for both humans and code agents. I think it would be useful to provide a data proxy that can be imported instead, something like:
import inspect
class _Shim:
def __getattr__(self, name):
try:
return inspect.stack()[1].frame.f_globals[name]
except (KeyError, IndexError):
raise AttributeError(...)
server_data = _Shim()So that
import numpy as np
np.random.seed(seed) # undefined name `seed`can be rewritten as
import numpy as np
from pytest_pl_grader import server_data
np.random.seed(server_data.seed)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels