Skip to content

Commit

Permalink
Removed some debugging print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis committed Nov 22, 2024
1 parent e6660f9 commit e59b633
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
4 changes: 4 additions & 0 deletions bindings/python/dlite-collection.i
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ int dlite_collection_remove(struct _DLiteCollection *coll, const char *label);
struct _DLiteInstance *
dlite_collection_get_new(const struct _DLiteCollection *coll,
const char *label, const char *metaid);

// Although dlite_collection_get_id() returns a borrowed reference in C,
// we create a new object in Python that must be properly deallocated.
%newobject dlite_collection_get_id;
const struct _DLiteInstance *
dlite_collection_get_id(const struct _DLiteCollection *coll, const char *id);

int dlite_collection_has(const struct _DLiteCollection *coll,
const char *label);
int dlite_collection_has_id(const struct _DLiteCollection *coll,
Expand Down
1 change: 1 addition & 0 deletions bindings/python/dlite-jstore.i
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ struct _JStore {};
}

%feature("docstring", "Iterate over all id's matching pattern.") get_ids;
%newobject get_ids;
struct _DLiteJStoreIter *get_ids(const char *pattern=NULL) {
return dlite_jstore_iter_create($self, pattern);
}
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/dlite-misc-python.i
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ class errctl():
return [_dlite._err_getcode(errname) for errname in errnames]


silent = errctl(filename="None")
"""Context manager for a silent code block. Same as `errctl(filename="None")`."""
silent = errctl(hide=True)
"""Context manager for a silent code block. Same as `errctl(hide=True)`."""

# A set for keeping track of already issued deprecation warnings
_deprecation_warning_record = set()
Expand Down
21 changes: 1 addition & 20 deletions src/tests/test_collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,30 +238,11 @@ MU_TEST(test_collection_load)
{
DLiteCollection *coll2;
char *collpath = STRINGIFY(dlite_SOURCE_DIR) "/src/tests/coll.json";
//DLiteStoragePathIter *iter;
//const char *path;

dlite_storage_paths_append(STRINGIFY(dlite_SOURCE_DIR) "/src/tests/*.json");
//printf("\n\nStorage paths:\n");
//iter = dlite_storage_paths_iter_start();
//while ((path = dlite_storage_paths_iter_next(iter)))
// printf(" - %s\n", path);
//printf("\n");
//dlite_storage_paths_iter_stop(iter);
FILE *fp = fopen(collpath, "r");
dlite_storage_paths_append(STRINGIFY(dlite_SOURCE_DIR) "/src/tests/*.json");
coll2 = (DLiteCollection *)
dlite_json_fscan(fp, NULL, "http://onto-ns.com/meta/0.1/Collection");
fclose(fp);
//printf("\n\n--- coll2: %p ---\n", (void *)coll2);
//dlite_json_print((DLiteInstance *)coll2);
//printf("----------------------\n");
const DLiteInstance *inst = dlite_collection_get(coll2, "inst");
//printf("\n--- inst: %p ---\n", (void *)inst);
//dlite_json_print((DLiteInstance *)inst);
//printf("----------------------\n");
dlite_collection_decref(coll2);
}
Expand Down

0 comments on commit e59b633

Please sign in to comment.