Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.3.12 #260

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update cvx.cpp (#263)
Signed-off-by: David P. Chassin <david.chassin@me.com>
  • Loading branch information
dchassin authored Jan 9, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 4430afc5e5773586fea22885e55f9ed444dc4882
11 changes: 10 additions & 1 deletion module/optimize/cvx.cpp
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ cvx *cvx::defaults = NULL;

// convenience objects
PyObject *gld = NULL;
PyObject *mod_list = NULL;
PyObject *class_dict = NULL;
PyObject *global_list = NULL;
PyObject *object_dict = NULL;
@@ -188,9 +189,11 @@ cvx::cvx(MODULE *module)

// create gld global
gld = PyModule_New("gld");
mod_list = PyList_New(0);
class_dict = PyDict_New();
global_list = PyList_New(0);
object_dict = PyDict_New();
PyModule_AddObject(gld,"modules",mod_list);
PyModule_AddObject(gld,"classes",class_dict);
PyModule_AddObject(gld,"globals",global_list);
PyModule_AddObject(gld,"objects",object_dict);
@@ -315,8 +318,14 @@ int cvx::init(OBJECT *parent)
PyList_Append(global_list,PyUnicode_FromString(var->prop->name));
}

// construct module list
for ( MODULE *module = gl_module_getfirst() ; module != NULL ; module = module->next )
{
PyList_Append(mod_list,PyUnicode_FromString(module->name));
}

// construct class data dictionary
for ( CLASS *oclass = callback->class_getfirst() ; oclass != NULL ; oclass = oclass->next )
for ( CLASS *oclass = gl_class_get_first() ; oclass != NULL ; oclass = oclass->next )
{
PyObject *defs = PyList_New(0);
for ( PROPERTY *prop = oclass->pmap ; prop != NULL && prop->oclass == oclass ; prop = prop->next )