From 7a29495c758819c989b0def8ec1da69ae3ce8629 Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Thu, 29 Aug 2024 19:33:28 +0100 Subject: [PATCH 1/3] refactor: avoid spooky action at a distance in init --- pysrc/juliacall/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pysrc/juliacall/__init__.py b/pysrc/juliacall/__init__.py index 6bc61fd4..936e08af 100644 --- a/pysrc/juliacall/__init__.py +++ b/pysrc/juliacall/__init__.py @@ -109,9 +109,9 @@ def int_option(name, *, accept_auto=False, **kw): except ValueError: raise ValueError(f'{s}: expecting an int'+(' or auto' if accept_auto else "")) - def args_from_config(): - argv = [CONFIG['exepath']] - for opt, val in CONFIG.items(): + def args_from_config(config): + argv = [config['exepath']] + for opt, val in config.items(): if opt.startswith('opt_'): if val is None: if opt == 'opt_handle_signals': @@ -181,7 +181,7 @@ def args_from_config(): CONFIG['lib'] = lib = c.PyDLL(libpath, mode=c.RTLD_GLOBAL) # parse options - argc, argv = args_from_config() + argc, argv = args_from_config(CONFIG) jl_parse_opts = lib.jl_parse_opts jl_parse_opts.argtypes = [c.c_void_p, c.c_void_p] jl_parse_opts.restype = None From 4968d94c12d2a0287934bb1aa0bff60eff722724 Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Thu, 29 Aug 2024 19:35:04 +0100 Subject: [PATCH 2/3] feat: add heap-size-hint --- pysrc/juliacall/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pysrc/juliacall/__init__.py b/pysrc/juliacall/__init__.py index 936e08af..722b0ea5 100644 --- a/pysrc/juliacall/__init__.py +++ b/pysrc/juliacall/__init__.py @@ -146,6 +146,7 @@ def args_from_config(config): CONFIG['opt_warn_overwrite'] = choice('warn_overwrite', ['yes', 'no'])[0] CONFIG['opt_handle_signals'] = choice('handle_signals', ['yes', 'no'])[0] CONFIG['opt_startup_file'] = choice('startup_file', ['yes', 'no'])[0] + CONFIG['opt_heap_size_hint'] = option('heap_size_hint')[0] # Stop if we already initialised if CONFIG['inited']: From 022f5473ad1157db26c8407d61637772187af5a3 Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Sun, 1 Dec 2024 23:58:35 +0000 Subject: [PATCH 3/3] docs: add heap-size-hint to docs and release notes --- docs/src/juliacall.md | 1 + docs/src/releasenotes.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/src/juliacall.md b/docs/src/juliacall.md index 2587aa10..27cd8c73 100644 --- a/docs/src/juliacall.md +++ b/docs/src/juliacall.md @@ -124,6 +124,7 @@ be configured in two ways: | `-X juliacall-threads=` | `PYTHON_JULIACALL_THREADS=` | Launch N threads. | | `-X juliacall-warn-overwrite=` | `PYTHON_JULIACALL_WARN_OVERWRITE=` | Enable or disable method overwrite warnings. | | `-X juliacall-autoload-ipython-extension=` | `PYTHON_JULIACALL_AUTOLOAD_IPYTHON_EXTENSION=` | Enable or disable IPython extension autoloading. | +| `-X juliacall-heap-size-hint=` | `PYTHON_JULIACALL_HEAP_SIZE_HINT=` | Hint for initial heap size in bytes. | ## [Multi-threading](@id py-multi-threading) diff --git a/docs/src/releasenotes.md b/docs/src/releasenotes.md index 80949200..627d9de5 100644 --- a/docs/src/releasenotes.md +++ b/docs/src/releasenotes.md @@ -1,5 +1,8 @@ # Release Notes +## 0.9.24 +* Added `PYTHON_JULIACALL_HEAP_SIZE_HINT` option to configure initial Julia heap size. + ## 0.9.23 (2024-08-22) * Bug fixes.