Skip to content

Commit

Permalink
More bug fixes
Browse files Browse the repository at this point in the history
nbauernfeind committed Feb 11, 2024
1 parent 1b82a73 commit cae0428
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
import io.deephaven.engine.updategraph.DynamicNode;
import io.deephaven.hash.KeyedObjectHashMap;
import io.deephaven.hash.KeyedObjectKey;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.jetbrains.annotations.NotNull;

import java.util.HashMap;
@@ -82,7 +83,7 @@ public <T> void putParam(final String name, final T value) {
public Map<String, Object> toMap(@NotNull final Predicate<Map.Entry<String, Object>> predicate) {
final HashMap<String, Object> result = new HashMap<>();
valueRetrievers.entrySet().stream()
.map(e -> Map.entry(e.getKey(), (Object) e.getValue().value))
.map(e -> ImmutablePair.of(e.getKey(), (Object) e.getValue().value))
.filter(predicate)
.forEach(e -> result.put(e.getKey(), e.getValue()));
return result;
Original file line number Diff line number Diff line change
@@ -42,6 +42,10 @@ public class PyCallableWrapperJpyImpl implements PyCallableWrapper {
numpyType2JavaClass.put('O', Object.class);
}

public static void init() {
// this is invoked to force the static initializer to run immediately after Jpy is initialized
}

// TODO: support for vectorizing functions that return arrays
// https://github.com/deephaven/deephaven-core/issues/4649
private static final Set<Class<?>> vectorizableReturnTypes = Set.of(
Original file line number Diff line number Diff line change
@@ -47,6 +47,8 @@ public static PythonEvaluatorJpy withGlobals() throws IOException, InterruptedEx

private PythonEvaluatorJpy(PyDictWrapper globals) {
this.globals = globals;
// forcefully load this helper class which imports python modules
PyCallableWrapperJpyImpl.init();
}

public PythonScopeJpyImpl getScope() {

0 comments on commit cae0428

Please sign in to comment.