Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 13af2e3

Browse files
committed
Add argument names to python functions.
1 parent e68d4a9 commit 13af2e3

1 file changed

Lines changed: 24 additions & 17 deletions

File tree

cpp/frontend/python/frontend.cpp

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,35 +102,41 @@ PYBIND11_MODULE(task_maker_frontend, m) {
102102
pybind11::gil_scoped_acquire acquire;
103103
(*cb)(s);
104104
});
105-
})
106-
.def("getContentsToFile", &frontend::File::getContentsToFile);
105+
},
106+
"callback"_a)
107+
.def("getContentsToFile", &frontend::File::getContentsToFile, "path"_a,
108+
"overwrite"_a = true, "exist_ok"_a = true);
107109

108110
pybind11::class_<frontend::Fifo>(m, "Fifo");
109111

110112
pybind11::class_<frontend::Execution>(m, "Execution")
111-
.def("setExecutablePath", &frontend::Execution::setExecutablePath)
112-
.def("setExecutable", &frontend::Execution::setExecutable)
113-
.def("setStdin", &frontend::Execution::setStdin)
114-
.def("addInput", &frontend::Execution::addInput)
115-
.def("addFifo", &frontend::Execution::addFifo)
116-
.def("setArgs", &frontend::Execution::setArgs)
113+
.def("setExecutablePath", &frontend::Execution::setExecutablePath,
114+
"path"_a)
115+
.def("setExecutable", &frontend::Execution::setExecutable, "name"_a,
116+
"file"_a)
117+
.def("setStdin", &frontend::Execution::setStdin, "file"_a)
118+
.def("addInput", &frontend::Execution::addInput, "name"_a, "file"_a)
119+
.def("addFifo", &frontend::Execution::addFifo, "name"_a, "fifo"_a)
120+
.def("setArgs", &frontend::Execution::setArgs, "args"_a)
117121
.def("disableCache", &frontend::Execution::disableCache)
118122
.def("makeExclusive", &frontend::Execution::makeExclusive)
119-
.def("setLimits", &frontend::Execution::setLimits)
120-
.def("setExtraTime", &frontend::Execution::setExtraTime)
123+
.def("setLimits", &frontend::Execution::setLimits, "limits"_a)
124+
.def("setExtraTime", &frontend::Execution::setExtraTime, "extra_time"_a)
121125
.def("stdout", &frontend::Execution::stdout,
122-
pybind11::return_value_policy::reference)
126+
pybind11::return_value_policy::reference, "is_executable"_a = false)
123127
.def("stderr", &frontend::Execution::stderr,
124-
pybind11::return_value_policy::reference)
128+
pybind11::return_value_policy::reference, "is_executable"_a = false)
125129
.def("output", &frontend::Execution::output,
126-
pybind11::return_value_policy::reference)
130+
pybind11::return_value_policy::reference, "name"_a,
131+
"is_executable"_a = false)
127132
.def("notifyStart",
128133
[](frontend::Execution& f, std::function<void()> cb) {
129134
f.notifyStart([cb = destroy_with_gil(cb)]() mutable {
130135
pybind11::gil_scoped_acquire acquire;
131136
(*cb)();
132137
});
133-
})
138+
},
139+
"callback"_a)
134140
.def("getResult",
135141
[](frontend::Execution& f, std::function<void(frontend::Result)> cb,
136142
std::function<void()> err = nullptr) {
@@ -148,16 +154,17 @@ PYBIND11_MODULE(task_maker_frontend, m) {
148154

149155
pybind11::class_<frontend::ExecutionGroup>(m, "ExecutionGroup")
150156
.def("addExecution", &frontend::ExecutionGroup::addExecution,
151-
pybind11::return_value_policy::reference)
157+
pybind11::return_value_policy::reference, "description"_a)
152158
.def("createFifo", &frontend::ExecutionGroup::createFifo,
153159
pybind11::return_value_policy::reference);
154160

155161
pybind11::class_<frontend::Frontend>(m, "Frontend")
156162
.def(pybind11::init<std::string, int>())
157163
.def("provideFile", &frontend::Frontend::provideFile,
158-
pybind11::return_value_policy::reference)
164+
pybind11::return_value_policy::reference, "path"_a, "description"_a,
165+
"is_executable"_a = false)
159166
.def("addExecution", &frontend::Frontend::addExecution,
160-
pybind11::return_value_policy::reference)
167+
pybind11::return_value_policy::reference, "description"_a)
161168
.def("addExecutionGroup", &frontend::Frontend::addExecutionGroup,
162169
pybind11::return_value_policy::reference)
163170
.def("evaluate", &frontend::Frontend::evaluate,

0 commit comments

Comments
 (0)