diff --git a/docs/server/Julia.rst b/docs/server/Julia.rst index 1e639e5..4fdb513 100644 --- a/docs/server/Julia.rst +++ b/docs/server/Julia.rst @@ -36,12 +36,12 @@ The server can be started with .. code-block:: sh - run-bmi-server --lang julia --name --port + run-bmi-server --lang julia --name [,IMPLEMENTATION-NAME] --port For example with [Wflow.jl](https://github.com/Deltares/Wflow.jl/) use .. code-block:: sh - run-bmi-server --lang julia --name Wflow.Model --port 55555 + run-bmi-server --lang julia --name Wflow.Model,Wflow.bmi.BMI --port 55555 The Python grpc4bmi :ref:`usage` can then be used to connect to the server. diff --git a/grpc4bmi/run_server.py b/grpc4bmi/run_server.py index c4593bf..a850143 100755 --- a/grpc4bmi/run_server.py +++ b/grpc4bmi/run_server.py @@ -78,10 +78,10 @@ def build_r(class_name, source_fn): raise ValueError('Missing R dependencies, install with `pip install grpc4bmi[R]') return BmiR(class_name, source_fn) -def build_julia(name: str): +def build_julia(name: str, implementation_name: str = 'BasicModelInterface'): if not BmiJulia: raise ValueError('Missing Julia dependencies, install with `pip install grpc4bmi[julia]') - return BmiJulia.from_name(name) + return BmiJulia.from_name(name, implementation_name) def serve(model, port): server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) @@ -120,7 +120,13 @@ def main(argv=sys.argv[1:]): if args.language == "R": model = build_r(args.name, path) elif args.language == "julia": - model = build_julia(args.name) + names = args.name.split(',') + if len(names) == 2: + model = build_julia(names[0], names[1]) + else: + model = build_julia(names[0]) + # model.initialize('t') + # print(model.get_component_name()) else: model = build(args.name, path)