@@ -180,7 +180,7 @@ FUNCTIONS
180180
181181 This function is a shortcut for Java' s System.gc().
182182
183- :raise RuntimeError : if the JVM has not yet been started.
183+ :raise RuntimeError : If the JVM has not started yet .
184184
185185 get_version(java_class_or_python_package) -> str
186186 Return the version of a Java class or Python package.
@@ -213,13 +213,13 @@ FUNCTIONS
213213 those actions via the jpype.setupGuiEnvironment wrapper function;
214214 see the Troubleshooting section of the scyjava README for details.
215215
216- is_jarray(data) -> bool
216+ is_jarray(data: Any ) -> bool
217217 Return whether the given data object is a Java array.
218218
219219 is_jvm_headless() -> bool
220220 Return true iff Java is running in headless mode.
221221
222- :raises RuntimeError : If the JVM has not started yet.
222+ :raise RuntimeError : If the JVM has not started yet.
223223
224224 is_memoryarraylike(arr: Any) -> bool
225225 Return True iff the object is memoryarraylike:
@@ -265,7 +265,7 @@ FUNCTIONS
265265 :param lengths: List of lengths for the array. For example:
266266 `jarray(' z' , [3 , 7 ])` is the equivalent of `new boolean[3 ][7 ]` in Java.
267267 You can pass a single integer to make a 1 - dimensional array of that length.
268- :returns : The newly allocated array
268+ :return : The newly allocated array
269269
270270 jclass(data)
271271 Obtain a Java class object .
@@ -285,22 +285,23 @@ FUNCTIONS
285285 i.e. the Java class for the Class class . :- )
286286
287287 :param data: The object from which to glean the class .
288- :returns : A java.lang.Class object , suitable for use with reflection.
289- :raises TypeError : if the argument is not one of the aforementioned types.
288+ :return : A java.lang.Class object , suitable for use with reflection.
289+ :raise TypeError : if the argument is not one of the aforementioned types.
290290
291291 jimport(class_name: str )
292292 Import a class from Java to Python.
293293
294294 :param class_name: Name of the class to import .
295- :returns: A pointer to the class , which can be used to
296- e.g. instantiate objects of that class .
295+ :return :
296+ A pointer to the class , which can be used to
297+ e.g. instantiate objects of that class .
297298
298299 jinstance(obj, jtype) -> bool
299300 Test if the given object is an instance of a particular Java type .
300301
301302 :param obj: The object to check.
302303 :param jtype: The Java type , as either a jimported class or as a string.
303- :returns : True iff the object is an instance of that Java type .
304+ :return : True iff the object is an instance of that Java type .
304305
305306 jstacktrace(exc) -> str
306307 Extract the Java- side stack trace from a Java exception.
@@ -315,7 +316,7 @@ FUNCTIONS
315316 print (jstacktrace(exc))
316317
317318 :param exc: The Java Throwable from which to extract the stack trace.
318- :returns : A multi- line string containing the stack trace, or empty string
319+ :return : A multi- line string containing the stack trace, or empty string
319320 if no stack trace could be extracted.
320321
321322 jvm_started() -> bool
@@ -379,8 +380,18 @@ FUNCTIONS
379380 :return : The used memory in bytes .
380381 :raise RuntimeError : if the JVM has not yet been started.
381382
383+ numeric_bounds(the_type: type ) -> Union[Tuple[int , int ], Tuple[float , float ], Tuple[NoneType, NoneType]]
384+ Get the minimum and maximum values for the given numeric type .
385+ For example, a Java long returns (int (Long.MIN_VALUE ), int (Long.MAX_VALUE )),
386+ whereas a Java double returns (float (- Double.MAX_VALUE ), float (Double.MAX_VALUE )).
387+
388+ :param the_type: The type whose minimum and maximum values are needed.
389+ :return :
390+ The minimum and maximum values as a two- element tuple of int or float ,
391+ or a two- element tuple of None if no known bounds.
392+
382393 shutdown_jvm() -> None
383- Shutdown the JVM .
394+ Shut down the JVM .
384395
385396 This function makes a best effort to clean up Java resources first.
386397 In particular, shutdown hooks registered with scyjava.when_jvm_stops
@@ -398,7 +409,7 @@ FUNCTIONS
398409 Note that if the JVM is not already running, then this function does
399410 nothing! In particular, shutdown hooks are skipped in this situation.
400411
401- :raises RuntimeError : if this method is called while in Jep mode.
412+ :raise RuntimeError : if this method is called while in Jep mode.
402413
403414 start_jvm(options = None ) -> None
404415 Explicitly connect to the Java virtual machine (JVM ). Only one JVM can
@@ -407,8 +418,9 @@ FUNCTIONS
407418 time a scyjava function needing a JVM is invoked, one is started on the
408419 fly with the configuration specified via the scijava.config mechanism.
409420
410- :param options: List of options to pass to the JVM . For example:
411- [' -Dfoo=bar' , ' -XX:+UnlockExperimentalVMOptions' ]
421+ :param options:
422+ List of options to pass to the JVM .
423+ For example: [' -Dfoo=bar' , ' -XX:+UnlockExperimentalVMOptions' ]
412424
413425 to_java(obj: Any, ** hints: Dict) -> Any
414426 Recursively convert a Python object to a Java object .
@@ -451,11 +463,13 @@ FUNCTIONS
451463 * float values in Double range but outside float range convert to Double
452464 * float values outside double range convert to BigDecimal
453465
454- :param obj: The Python object to convert.
455- :param hints: An optional dictionary of hints, to help scyjava
456- make decisions about how to do the conversion.
457- :returns: A corresponding Java object with the same contents.
458- :raises TypeError : if the argument is not one of the aforementioned types.
466+ :param obj:
467+ The Python object to convert.
468+ :param hints:
469+ An optional dictionary of hints, to help scyjava
470+ make decisions about how to do the conversion.
471+ :return : A corresponding Java object with the same contents.
472+ :raise TypeError : if the argument is not one of the aforementioned types.
459473
460474 to_python(data: Any, gentle: bool = False ) -> Any
461475 Recursively convert a Java object to a Python object .
@@ -472,12 +486,15 @@ FUNCTIONS
472486 * Iterable -> collections.abc.Iterable
473487 * Iterator -> collections.abc.Iterator
474488
475- :param data: The Java object to convert.
476- :param gentle: If set , and the type cannot be converted, leaves
477- the data alone rather than raising a TypeError .
478- :returns: A corresponding Python object with the same contents.
479- :raises TypeError : if the argument is not one of the aforementioned types,
480- and the gentle flag is not set .
489+ :param data:
490+ The Java object to convert.
491+ :param gentle:
492+ If set , and the type cannot be converted, leaves
493+ the data alone rather than raising a TypeError .
494+ :return : A corresponding Python object with the same contents.
495+ :raise TypeError :
496+ if the argument is not one of the aforementioned types,
497+ and the gentle flag is not set .
481498
482499 when_jvm_starts(f) -> None
483500 Registers a function to be called when the JVM starts (or immediately).
0 commit comments