diff --git a/docs/README.md b/docs/README.md index 217991a65..ca5fda583 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,7 +15,7 @@ Safely develop Data Science programs with a statically checked domain specific l 2. To _execute_ Safe-DS programs, the [Safe-DS Runner](https://github.com/Safe-DS/Runner) has to be installed and configured additionally: 1. Install [Python](https://www.python.org/) (3.11 or 3.12). - 2. Run `pip install "safe-ds-runner>=0.8.0,<0.9.0"` in a command line to download the latest matching Runner version + 2. Run `pip install "safe-ds-runner>=0.9.0,<0.10.0"` in a command line to download the latest matching Runner version from [PyPI](https://pypi.org/project/safe-ds-runner/). 3. If the Visual Studio Code extension cannot start the runner, adjust the setting `safe-ds.runner.command`. Enter the absolute path to the Runner executable, as seen in the image below. diff --git a/packages/safe-ds-lang/src/language/generation/safe-ds-python-generator.ts b/packages/safe-ds-lang/src/language/generation/safe-ds-python-generator.ts index e775ed899..f291eafae 100644 --- a/packages/safe-ds-lang/src/language/generation/safe-ds-python-generator.ts +++ b/packages/safe-ds-lang/src/language/generation/safe-ds-python-generator.ts @@ -959,9 +959,21 @@ export class SafeDsPythonGenerator { const memoizedArgs = getParameters(callable).map( (parameter) => this.nodeMapper.callToParameterValue(expression, parameter)!, ); + if (isSdsFunction(callable) && !isStatic(callable) && isSdsMemberAccess(expression.receiver)) { + return expandTracedToNode( + expression, + )`${RUNNER_PACKAGE}.memoized_dynamic_call("${this.getPythonNameOrDefault( + callable, + )}", lambda *_ : ${generatedPythonCall}, [${thisParam}, ${joinTracedToNode( + expression.argumentList, + 'arguments', + )(memoizedArgs, (arg) => this.generateExpression(arg, frame), { + separator: ', ', + })}], [${joinToNode(hiddenParameters, (param) => param, { separator: ', ' })}])`; + } return expandTracedToNode( expression, - )`${RUNNER_PACKAGE}.memoized_call("${this.generateFullyQualifiedFunctionName( + )`${RUNNER_PACKAGE}.memoized_static_call("${this.generateFullyQualifiedFunctionName( expression, )}", lambda *_ : ${generatedPythonCall}, [${joinTracedToNode(expression.argumentList, 'arguments')( memoizedArgs, @@ -1023,26 +1035,36 @@ export class SafeDsPythonGenerator { Parameter.isOptional(this.nodeMapper.argumentToParameter(arg)), ); const fullyQualifiedTargetName = this.generateFullyQualifiedFunctionName(expression); + if (isSdsFunction(callable) && !isStatic(callable) && isSdsMemberAccess(expression.receiver)) { + return expandTracedToNode( + expression, + )`${RUNNER_PACKAGE}.memoized_dynamic_call("${this.getPythonNameOrDefault(callable)}", ${ + containsOptionalArgs ? 'lambda *_ : ' : '' + }${ + containsOptionalArgs ? this.generatePlainCall(expression, sortedArgs, frame) : 'None' + }, [${generateThisParam ? thisParam : ''}${ + generateThisParam && memoizedArgs.length > 0 ? ', ' : '' + }${joinTracedToNode(expression.argumentList, 'arguments')( + memoizedArgs, + (arg) => this.generateExpression(arg, frame), + { + separator: ', ', + }, + )}], [${joinToNode(hiddenParameters, (param) => param, { separator: ', ' })}])`; + } if (!containsOptionalArgs && isSdsMemberAccess(expression.receiver)) { const classDeclaration = getOutermostContainerOfType(callable, isSdsClass)!; const referenceImport = this.createImportDataForNode(classDeclaration, expression.receiver.member!); frame.addImport(referenceImport); } - return expandTracedToNode(expression)`${RUNNER_PACKAGE}.memoized_call("${fullyQualifiedTargetName}", ${ + return expandTracedToNode(expression)`${RUNNER_PACKAGE}.memoized_static_call("${fullyQualifiedTargetName}", ${ containsOptionalArgs ? 'lambda *_ : ' : '' }${ containsOptionalArgs ? this.generatePlainCall(expression, sortedArgs, frame) - : isSdsMemberAccess(expression.receiver) && isSdsCall(expression.receiver.receiver) - ? isSdsMemberAccess(expression.receiver.receiver.receiver) - ? this.getClassQualifiedNameForMember(callable) - : expandTracedToNode(expression.receiver)`${this.generateExpression( - expression.receiver.receiver.receiver, - frame, - )}.${this.generateExpression(expression.receiver.member!, frame)}` - : isSdsMemberAccess(expression.receiver) - ? this.getClassQualifiedNameForMember(callable) - : this.generateExpression(expression.receiver, frame) + : isSdsMemberAccess(expression.receiver) + ? this.getClassQualifiedNameForMember(callable) + : this.generateExpression(expression.receiver, frame) }, [${generateThisParam ? thisParam : ''}${ generateThisParam && memoizedArgs.length > 0 ? ', ' : '' }${joinTracedToNode(expression.argumentList, 'arguments')( @@ -1055,7 +1077,9 @@ export class SafeDsPythonGenerator { } private getMemoizedCallHiddenParameters(expression: SdsCall, frame: GenerationInfoFrame): CompositeGeneratorNode[] { - const impurityReasons = this.purityComputer.getImpurityReasonsForExpression(expression); + const impurityReasons = this.purityComputer.getImpurityReasonsForCallable( + this.nodeMapper.callToCallable(expression), + ); const hiddenParameters: CompositeGeneratorNode[] = []; for (const reason of impurityReasons) { if (reason instanceof FileRead) { diff --git a/packages/safe-ds-lang/src/language/runner/safe-ds-runner.ts b/packages/safe-ds-lang/src/language/runner/safe-ds-runner.ts index 3e9c362aa..545016adc 100644 --- a/packages/safe-ds-lang/src/language/runner/safe-ds-runner.ts +++ b/packages/safe-ds-lang/src/language/runner/safe-ds-runner.ts @@ -24,8 +24,8 @@ import { SafeDsMessagingProvider } from '../lsp/safe-ds-messaging-provider.js'; export const RPC_RUNNER_STARTED = 'runner/started'; -const LOWEST_SUPPORTED_VERSION = '0.8.0'; -const LOWEST_UNSUPPORTED_VERSION = '0.9.0'; +const LOWEST_SUPPORTED_VERSION = '0.9.0'; +const LOWEST_UNSUPPORTED_VERSION = '0.10.0'; const npmVersionRange = `>=${LOWEST_SUPPORTED_VERSION} <${LOWEST_UNSUPPORTED_VERSION}`; const pipVersionRange = `>=${LOWEST_SUPPORTED_VERSION},<${LOWEST_UNSUPPORTED_VERSION}`; diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/main/generated/tests/generator/runnerIntegration/expressions/calls/main/gen_input.py b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/main/generated/tests/generator/runnerIntegration/expressions/calls/main/gen_input.py index e2421f5a5..353ac28bc 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/main/generated/tests/generator/runnerIntegration/expressions/calls/main/gen_input.py +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/main/generated/tests/generator/runnerIntegration/expressions/calls/main/gen_input.py @@ -22,37 +22,37 @@ def segment_a(a): # Pipelines -------------------------------------------------------------------- def test(): - f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.g", lambda *_ : g(1, param2=2), [1, 2], [])) - f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.g", lambda *_ : g(2, param2=1), [2, 1], [])) - f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.h", lambda *_ : h(1, param_2=2), [1, 2], [])) - f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.h", lambda *_ : h(2, param_2=1), [2, 1], [])) - f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.h", h, [2, 0], [])) + f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.g", lambda *_ : g(1, param2=2), [1, 2], [])) + f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.g", lambda *_ : g(2, param2=1), [2, 1], [])) + f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.h", lambda *_ : h(1, param_2=2), [1, 2], [])) + f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.h", lambda *_ : h(2, param_2=1), [2, 1], [])) + f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.h", h, [2, 0], [])) 'abc'.i() 'abc'.j(123) k(456, 1.23) - __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.g", lambda *_ : g(1, param2=2), [1, 2], []))) - __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.g", lambda *_ : g(2, param2=1), [2, 1], []))) - __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.h", lambda *_ : h(1, param_2=2), [1, 2], []))) - __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.h", lambda *_ : h(2, param_2=1), [2, 1], []))) - __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.h", h, [2, 0], []))) + __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.g", lambda *_ : g(1, param2=2), [1, 2], []))) + __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.g", lambda *_ : g(2, param2=1), [2, 1], []))) + __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.h", lambda *_ : h(1, param_2=2), [1, 2], []))) + __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.h", lambda *_ : h(2, param_2=1), [2, 1], []))) + __gen_null_safe_call(f, lambda: f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.h", h, [2, 0], []))) __gen_null_safe_call(i, lambda: 'abc'.i()) __gen_null_safe_call(j, lambda: 'abc'.j(123)) __gen_null_safe_call(k, lambda: k(456, 1.23)) - f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.readFile", readFile, [], [safeds_runner.file_mtime('a.txt')])) + f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.readFile", readFile, [], [safeds_runner.file_mtime('a.txt')])) f(l(lambda a: segment_a(a))) f(l(lambda a: (3) * (segment_a(a)))) - f(l(lambda a: safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [(3) * (segment_a(a))], []))) - f(l(lambda a: (3) * (safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [(3) * (segment_a(a))], [])], [])))) + f(l(lambda a: safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [(3) * (segment_a(a))], []))) + f(l(lambda a: (3) * (safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [(3) * (segment_a(a))], [])], [])))) def __gen_block_lambda_0(a): __gen_block_lambda_result_result = segment_a(a) return __gen_block_lambda_result_result f(l(__gen_block_lambda_0)) def __gen_block_lambda_1(a): - __gen_block_lambda_result_result = safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [segment_a(a)], []) + __gen_block_lambda_result_result = safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [segment_a(a)], []) return __gen_block_lambda_result_result f(l(__gen_block_lambda_1)) - f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.l", l, [lambda a: (3) * (a)], [])) + f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.l", l, [lambda a: (3) * (a)], [])) def __gen_block_lambda_2(a): - __gen_block_lambda_result_result = (3) * (safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [a], [])) + __gen_block_lambda_result_result = (3) * (safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.m", m, [a], [])) return __gen_block_lambda_result_result - f(safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.main.l", l, [__gen_block_lambda_2], [])) + f(safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.main.l", l, [__gen_block_lambda_2], [])) diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/main/generated/tests/generator/runnerIntegration/expressions/calls/main/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/main/generated/tests/generator/runnerIntegration/expressions/calls/main/gen_input.py.map index 351e57122..397450381 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/main/generated/tests/generator/runnerIntegration/expressions/calls/main/gen_input.py.map +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/main/generated/tests/generator/runnerIntegration/expressions/calls/main/gen_input.py.map @@ -1 +1 @@ -{"version":3,"sources":["input.sdstest"],"names":["segment_a","a","result","test","f","g","param2","h","i","j","k","readfile","l","m"],"mappings":"AAAA;;;;;;;;;;;;;;;;;AAiEA,IAAQA,SAAS,CAACC,CAAC;IACf,YAAMC,MAAM,GAAG,CAAAD,CAAC,EAAC,CAAC,EAAC,CAAC;IADE,OAAG;;;;AA9B7B,IAASE,IAAI;IACTC,CAAC,CAAE,sGAAAC,CAAC,CAAC,CAAC,EA9BNC,MAAM,CA8BE,CAAC,IAAJ,CAAC,EAAE,CAAC;IACTF,CAAC,CAAE,sGAAAC,CAAC,CAAsB,CAAC,EA/B3BC,MAAM,CA+BQ,CAAC,IAAW,CAAC,EAAb,CAAC;IACfF,CAAC,CAAE,sGAAAG,CAAC,CAAC,CAAC,EA3BiBD,OAAM,CA2BrB,CAAC,IAAJ,CAAC,EAAE,CAAC;IACTF,CAAC,CAAE,sGAAAG,CAAC,CAAsB,CAAC,EA5BJD,OAAM,CA4Bf,CAAC,IAAW,CAAC,EAAb,CAAC;IACfF,CAAC,CAAE,0FAAAG,CAAC,GAAU,CAAC,EA7BsB,CAAC;IA8BpC,KAAK;IACL,KAAK,GAAE,GAAG;IACZ,EAAQ,GAAG,EAAT,IAAI;IAEL,oBAAC,CAAFH,CAAC,UAADA,CAAC,CAAG,sGAAAC,CAAC,CAAC,CAAC,EAvCPC,MAAM,CAuCG,CAAC,IAAJ,CAAC,EAAE,CAAC;IACT,oBAAC,CAAFF,CAAC,UAADA,CAAC,CAAG,sGAAAC,CAAC,CAAsB,CAAC,EAxC5BC,MAAM,CAwCS,CAAC,IAAW,CAAC,EAAb,CAAC;IACf,oBAAC,CAAFF,CAAC,UAADA,CAAC,CAAG,sGAAAG,CAAC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AC,OAACX,CAAC,EAAK,CAAA,CAAC,EAAC,CAAC,EAACA,CAAC;IACZ,yBAACA,CAAC;QAAG,0BAAMC,MAAM,GAAG,CAAA,CAAC,EAAC,CAAC,EAAC,0FAAAW,CAAC,GAACZ,CAAC;QAA3B,OAAK,0BAAMC,MAAM;IAArBE,CAAC,CAAC,0FAAAQ,CAAC,GAAC","file":"gen_input.py"} \ No newline at end of file +{"version":3,"sources":["input.sdstest"],"names":["segment_a","a","result","test","f","g","param2","h","i","j","k","readfile","l","m"],"mappings":"AAAA;;;;;;;;;;;;;;;;;AAiEA,IAAQA,SAAS,CAACC,CAAC;IACf,YAAMC,MAAM,GAAG,CAAAD,CAAC,EAAC,CAAC,EAAC,CAAC;IADE,OAAG;;;;AA9B7B,IAASE,IAAI;IACTC,CAAC,CAAE,6GAAAC,CAAC,CAAC,CAAC,EA9BNC,MAAM,CA8BE,CAAC,IAAJ,CAAC,EAAE,CAAC;IACTF,CAAC,CAAE,6GAAAC,CAAC,CAAsB,CAAC,EA/B3BC,MAAM,CA+BQ,CAAC,IAAW,CAAC,EAAb,CAAC;IACfF,CAAC,CAAE,6GAAAG,CAAC,CAAC,CAAC,EA3BiBD,OAAM,CA2BrB,CAAC,IAAJ,CAAC,EAAE,CAAC;IACTF,CAAC,CAAE,6GAAAG,CAAC,CAAsB,CAAC,EA5BJD,OAAM,CA4Bf,CAAC,IAAW,CAAC,EAAb,CAAC;IACfF,CAAC,CAAE,iGAAAG,CAAC,GAAU,CAAC,EA7BsB,CAAC;IA8BpC,KAAK;IACL,KAAK,GAAE,GAAG;IACZ,EAAQ,GAAG,EAAT,IAAI;IAEL,oBAAC,CAAFH,CAAC,UAADA,CAAC,CAAG,6GAAAC,CAAC,CAAC,CAAC,EAvCPC,MAAM,CAuCG,CAAC,IAAJ,CAAC,EAAE,CAAC;IACT,oBAAC,CAAFF,CAAC,UAADA,CAAC,CAAG,6GAAAC,CAAC,CAAsB,CAAC,EAxC5BC,MAAM,CAwCS,CAAC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BAAMC,MAAM;IAArBE,CAAC,CAACQ,CAAC,CAAC;IACJR,CAAC,CAAC,iGAAAQ,CAAC,GAAC,OAACX,CAAC,EAAK,CAAA,CAAC,EAAC,CAAC,EAACA,CAAC;IACZ,yBAACA,CAAC;QAAG,0BAAMC,MAAM,GAAG,CAAA,CAAC,EAAC,CAAC,EAAC,iGAAAW,CAAC,GAACZ,CAAC;QAA3B,OAAK,0BAAMC,MAAM;IAArBE,CAAC,CAAC,iGAAAQ,CAAC,GAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/of classes/generated/tests/generator/runnerIntegration/expressions/calls/ofClasses/gen_input.py b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/of classes/generated/tests/generator/runnerIntegration/expressions/calls/ofClasses/gen_input.py index 65bdf5af2..d271c4b95 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/of classes/generated/tests/generator/runnerIntegration/expressions/calls/ofClasses/gen_input.py +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/of classes/generated/tests/generator/runnerIntegration/expressions/calls/ofClasses/gen_input.py @@ -6,5 +6,5 @@ # Pipelines -------------------------------------------------------------------- def test(): - a = safeds_runner.memoized_call("tests.generator.runnerIntegration.expressions.calls.ofClasses.MyClass", MyClass, [0], []) + a = safeds_runner.memoized_static_call("tests.generator.runnerIntegration.expressions.calls.ofClasses.MyClass", MyClass, [0], []) safeds_runner.save_placeholder('a', a) diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/of classes/generated/tests/generator/runnerIntegration/expressions/calls/ofClasses/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/of classes/generated/tests/generator/runnerIntegration/expressions/calls/ofClasses/gen_input.py.map index a08bc444e..f158d45c9 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/of classes/generated/tests/generator/runnerIntegration/expressions/calls/ofClasses/gen_input.py.map +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/calls/of classes/generated/tests/generator/runnerIntegration/expressions/calls/ofClasses/gen_input.py.map @@ -1 +1 @@ -{"version":3,"sources":["input.sdstest"],"names":["test","myclass"],"mappings":"AAEA;;;;;;;AAIA,IAASA,IAAI;IACT,IAAQ,qGAAAC,OAAO,GAAC,CAAC;IAAjB","file":"gen_input.py"} \ No newline at end of file +{"version":3,"sources":["input.sdstest"],"names":["test","myclass"],"mappings":"AAEA;;;;;;;AAIA,IAASA,IAAI;IACT,IAAQ,4GAAAC,OAAO,GAAC,CAAC;IAAjB","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/generated/tests/generator/memberAccessWithRunnerIntegration/gen_input.py b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/generated/tests/generator/memberAccessWithRunnerIntegration/gen_input.py index 56511c266..6f3708953 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/generated/tests/generator/memberAccessWithRunnerIntegration/gen_input.py +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/generated/tests/generator/memberAccessWithRunnerIntegration/gen_input.py @@ -1,8 +1,8 @@ # Imports ---------------------------------------------------------------------- import safeds_runner -from safeds.data.image.containers import Image -from safeds.data.tabular.containers import Column, Table +from safeds.data.tabular.containers import Table +from safeds.data.tabular.transformation import OneHotEncoder from tests.generator.memberAccessWithRunnerIntegration import C, f, factory, factoryNested, g, h, Outer from typing import Any, TypeVar @@ -18,36 +18,52 @@ def __gen_null_safe_member_access(receiver: Any, member_name: str) -> __gen_T | # Pipelines -------------------------------------------------------------------- def test(): - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.g", g, [], [])) - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.h", h, [], [])[0]) - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.h", h, [], [])[1]) - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []).a) - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []).c) - f(__gen_null_safe_member_access(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.factory", factory, [], []), 'a')) - f(__gen_null_safe_member_access(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.factory", factory, [], []), 'c')) - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.C.i", lambda *_ : 1.i(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], [])), [1], [])) - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.C.j", C.j, [safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []), 123], [])) - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.C.k2", C.k2, [safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []), 'abc'], [])) - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.C.from_csv_file", C.from_csv_file, ['abc.csv'], [safeds_runner.file_mtime('abc.csv')])) - a = safeds_runner.memoized_call("safeds.data.tabular.containers.Table.from_csv_file", Table.from_csv_file, ['abc.csv'], [safeds_runner.file_mtime('abc.csv')]) + f(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.g", g, [], [])) + f(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.h", h, [], [])[0]) + f(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.h", h, [], [])[1]) + f(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []).a) + f(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []).c) + f(__gen_null_safe_member_access(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.factory", factory, [], []), 'a')) + f(__gen_null_safe_member_access(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.factory", factory, [], []), 'c')) + f(safeds_runner.memoized_dynamic_call("i", lambda *_ : 1.i(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], [])), [safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []), 1], [])) + c1 = safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []) + safeds_runner.save_placeholder('c1', c1) + f(safeds_runner.memoized_dynamic_call("i", lambda *_ : 1.i(c1), [c1, 1], [])) + f(safeds_runner.memoized_dynamic_call("j", None, [safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []), 123], [])) + f(safeds_runner.memoized_dynamic_call("k2", None, [safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []), 'abc'], [])) + f(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C.l", lambda *_ : 2.i(), [2], [])) + f(safeds_runner.memoized_dynamic_call("m", lambda *_ : safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []).m(param=213), [safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C", C, [], []), 213], [])) + f(safeds_runner.memoized_dynamic_call("m", lambda *_ : c1.m(param=213), [c1, 213], [])) + f(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C.n", lambda *_ : C.n(param=213), [213], [])) + f(safeds_runner.memoized_dynamic_call("m", lambda *_ : safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C.o", C.o, [42], []).m(param=213), [safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C.o", C.o, [42], []), 213], [])) + f(safeds_runner.memoized_dynamic_call("j", None, [safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C.o", C.o, [42], []), 213], [])) + f(safeds_runner.memoized_dynamic_call("j", None, [safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C.p", C.p, [], []), 213], [])) + f(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.C.from_csv_file", C.from_csv_file, ['abc.csv'], [safeds_runner.file_mtime('abc.csv')])) + a = safeds_runner.memoized_static_call("safeds.data.tabular.containers.Table.from_csv_file", Table.from_csv_file, ['abc.csv'], [safeds_runner.file_mtime('abc.csv')]) safeds_runner.save_placeholder('a', a) - v = safeds_runner.memoized_call("safeds.data.tabular.containers.Table.get_column", Table.get_column, [a, 'b'], []) + a2 = safeds_runner.memoized_dynamic_call("remove_columns", None, [safeds_runner.memoized_static_call("safeds.data.tabular.containers.Table.from_csv_file", Table.from_csv_file, ['abc.csv'], [safeds_runner.file_mtime('abc.csv')]), ['u']], []) + safeds_runner.save_placeholder('a2', a2) + v = safeds_runner.memoized_dynamic_call("get_column", None, [a, 'b'], []) safeds_runner.save_placeholder('v', v) - d = safeds_runner.memoized_call("safeds.data.tabular.containers.Column.plot_histogram", Column.plot_histogram, [v], []) + d = safeds_runner.memoized_dynamic_call("plot_histogram", None, [v], []) safeds_runner.save_placeholder('d', d) - p = safeds_runner.memoized_call("safeds.data.tabular.containers.Column.plot_histogram", Column.plot_histogram, [safeds_runner.memoized_call("safeds.data.tabular.containers.Table.get_column", Table.get_column, [a, 'b'], [])], []) + p = safeds_runner.memoized_dynamic_call("plot_histogram", None, [safeds_runner.memoized_dynamic_call("get_column", None, [a, 'b'], [])], []) safeds_runner.save_placeholder('p', p) - r = safeds_runner.memoized_call("safeds.data.image.containers.Image.flip_vertically", Image.flip_vertically, [safeds_runner.memoized_call("safeds.data.tabular.containers.Column.plot_histogram", Column.plot_histogram, [safeds_runner.memoized_call("safeds.data.tabular.containers.Table.get_column", Table.get_column, [a, 'b'], [])], [])], []) + r = safeds_runner.memoized_dynamic_call("flip_vertically", None, [safeds_runner.memoized_dynamic_call("plot_histogram", None, [safeds_runner.memoized_dynamic_call("get_column", None, [a, 'b'], [])], [])], []) safeds_runner.save_placeholder('r', r) - q = safeds_runner.memoized_call("safeds.data.image.containers.Image.adjust_contrast", Image.adjust_contrast, [safeds_runner.memoized_call("safeds.data.image.containers.Image.flip_vertically", Image.flip_vertically, [safeds_runner.memoized_call("safeds.data.tabular.containers.Column.plot_histogram", Column.plot_histogram, [safeds_runner.memoized_call("safeds.data.tabular.containers.Table.get_column", Table.get_column, [a, 'b'], [])], [])], []), 1.2], []) + q = safeds_runner.memoized_dynamic_call("adjust_contrast", None, [safeds_runner.memoized_dynamic_call("flip_vertically", None, [safeds_runner.memoized_dynamic_call("plot_histogram", None, [safeds_runner.memoized_dynamic_call("get_column", None, [a, 'b'], [])], [])], []), 1.2], []) safeds_runner.save_placeholder('q', q) f(d) f(p) f(r) f(q) - f(safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.Outer.Nested.f", Outer.Nested.f, [], [])) - nestedInstance = safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.factoryNested", factoryNested, [], []) + f(safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.Outer.Nested.f", Outer.Nested.f, [], [])) + nestedInstance = safeds_runner.memoized_static_call("tests.generator.memberAccessWithRunnerIntegration.factoryNested", factoryNested, [], []) safeds_runner.save_placeholder('nestedInstance', nestedInstance) - nestedResult = safeds_runner.memoized_call("tests.generator.memberAccessWithRunnerIntegration.Outer.Nested.g", Outer.Nested.g, [nestedInstance], []) + nestedResult = safeds_runner.memoized_dynamic_call("g", None, [nestedInstance], []) safeds_runner.save_placeholder('nestedResult', nestedResult) f(nestedResult) + encoder = safeds_runner.memoized_dynamic_call("fit", None, [safeds_runner.memoized_static_call("safeds.data.tabular.transformation.OneHotEncoder", OneHotEncoder, [], []), a, ['b']], []) + safeds_runner.save_placeholder('encoder', encoder) + transformedTable = safeds_runner.memoized_dynamic_call("transform", None, [encoder, a], []) + safeds_runner.save_placeholder('transformedTable', transformedTable) diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/generated/tests/generator/memberAccessWithRunnerIntegration/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/generated/tests/generator/memberAccessWithRunnerIntegration/gen_input.py.map index b803421b8..a8a573074 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/generated/tests/generator/memberAccessWithRunnerIntegration/gen_input.py.map +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/generated/tests/generator/memberAccessWithRunnerIntegration/gen_input.py.map @@ -1 +1 @@ -{"version":3,"sources":["input.sdstest"],"names":["test","f","g","h","result1","result2","c","a","b","factory","j","k","v","d","p","r","q","factorynested","nestedinstance","nestedresult"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;AAwCA,IAASA,IAAI;IACTC,CAAC,CAAC,mFAAAC,CAAC;IACHD,CAAC,CAAC,mFAAAE,CAAC,UAAGC,CAAO;IACbH,CAAC,CAAC,mFAAAE,CAAC,UAAGE,CAAO;IACbJ,CAAC,CAAC,mFAAAK,CAAC,UAAGC,CAAC;IACPN,CAAC,CAAC,mFAAAK,CAAC,UAAGE,CAAC;IACPP,CAAC,CAAU,6BAAC,CAAV,yFAAAQ,OAAO,YAAIF,CAAC;IACdN,CAAC,CAAU,6BAAC,CAAV,yFAAAQ,OAAO,YAAID,CAAC;IACdP,CAAC,CAAC,iGAAM,CAAC,GAAP,mFAAAK,CAAC,aAAK,CAAC;IACTL,CAAC,CAAC,qFAAAK,CAAC,CAAGI,CAAC,GAAL,mFAAAJ,CAAC,WAAK,GAAG;IACXL,CAAC,CAAC,sFAAAK,CAAC,CAAGK,EAAC,GAAL,mFAAAL,CAAC,WAAK,KAAK;IACbL,CAAC,CAAC,mHAAgB,SAAS,IAAT,yBAAA,SAAS;IAC3B,IAAQ,wGAAkB,SAAS,IAAT,yBAAA,SAAS;IAAnC;IACA,IAAQ,kGAAAM,CAAC,EAAW,GAAG;IAAvB;IACA,IAAQ,4GAAAK,CAAC;IAAT;IACA,IAAQ,4GAAW,kGAAXL,CAAC,EAAW,GAAG;IAAvB;IACA,IAAQ,0GAA8B,4GAAnB,kGAAXA,CAAC,EAAW,GAAG;IAAvB;IACA,IAAQ,0GAA+C,0GAAjB,4GAAnB,kGAAXA,CAAC,EAAW,GAAG,oBAAkD,GAAG;IAA5E;IACAN,CAAC,CAACY,CAAC;IACHZ,CAAC,CAACa,CAAC;IACHb,CAAC,CAACc,CAAC;IACHd,CAAC,CAACe,CAAC;IACHf,CAAC,CAAC;IACF,iBAAqB,+FAAAgB,aAAa;IAAlC;IACA,eAAmB,iHAAAC,cAAc;IAAjC;IACAjB,CAAC,CAACkB,YAAY","file":"gen_input.py"} \ No newline at end of file +{"version":3,"sources":["input.sdstest"],"names":["test","f","g","h","result1","result2","c","a","b","factory","c1","m","param","n","v","d","p","r","q","factorynested","nestedinstance","nestedresult","onehotencoder","encoder"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;AAwDA,IAASA,IAAI;IACTC,CAAC,CAAC,0FAAAC,CAAC;IACHD,CAAC,CAAC,0FAAAE,CAAC,UAAGC,CAAO;IACbH,CAAC,CAAC,0FAAAE,CAAC,UAAGE,CAAO;IACbJ,CAAC,CAAC,0FAAAK,CAAC,UAAGC,CAAC;IACPN,CAAC,CAAC,0FAAAK,CAAC,UAAGE,CAAC;IACPP,CAAC,CAAU,6BAAC,CAAV,gGAAAQ,OAAO,YAAIF,CAAC;IACdN,CAAC,CAAU,6BAAC,CAAV,gGAAAQ,OAAO,YAAID,CAAC;IACdP,CAAC,CAAC,qDAAM,CAAC,GAAP,0FAAAK,CAAC,aAAD,0FAAAA,CAAC,WAAK,CAAC;IACT,KAAS,0FAAAA,CAAC;IAAV;IACAL,CAAC,CAAC,qDAAK,CAAC,GAANS,EAAE,IAAFA,EAAE,EAAG,CAAC;IACRT,CAAC,CAAC,gDAAA,0FAAAK,CAAC,WA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IACA,eAAmB,gDAAAC,cAAc;IAAjC;IACAnB,CAAC,CAACoB,YAAY;IACd,UAAc,kDAAA,uFAAAC,aAAa,WAAOf,CAAC,EAAE,CAAC,GAAG;IAAzC;IACA,mBAAuB,wDAAAgB,OAAO,EAAWhB,CAAC;IAA1C","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/input.sdstest b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/input.sdstest index 8c9128f46..9e137b518 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/input.sdstest +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/expressions/member access/input.sdstest @@ -20,6 +20,22 @@ class C() { @Pure @PythonName("k2") fun k(param: Any?) -> result: Boolean + @Pure + @PythonCall("$param.i()") + static fun l(param: Any?) -> result: Boolean + + @Pure + fun m(param: Int = 42) -> result: Boolean + + @Pure + static fun n(param: Int = 42) -> result: Boolean + + @Pure + static fun o(param: Int = 42) -> result: C + + @Pure + static fun p() -> result: C + @Impure([ImpurityReason.FileReadFromParameterizedPath("name")]) static fun from_csv_file(name: String) -> c: C } @@ -47,10 +63,20 @@ pipeline test { f(factory()?.a); f(factory()?.b); f(C().i(1)); + val c1 = C(); + f(c1.i(1)); f(C().j(123)); f(C().k("abc")); + f(C.l(2)); + f(C().m(213)); + f(c1.m(213)); + f(C.n(213)); + f(C.o().m(213)); + f(C.o().j(213)); + f(C.p().j(213)); f(C.from_csv_file("abc.csv")); val a = Table.fromCsvFile("abc.csv"); + val a2 = Table.fromCsvFile("abc.csv").removeColumns(["u"]); val v = a.getColumn("b"); val d = v.plotHistogram(); val p = a.getColumn("b").plotHistogram(); @@ -64,4 +90,6 @@ pipeline test { val nestedInstance = factoryNested(); val nestedResult = nestedInstance.g(); f(nestedResult); + val encoder = OneHotEncoder().fit(a, ["b"]); + val transformedTable = encoder.transform(a); } diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_context_same_package.py b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_context_same_package.py index 863009dd9..fc9694b65 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_context_same_package.py +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_context_same_package.py @@ -6,9 +6,9 @@ # Segments --------------------------------------------------------------------- def segment1InSamePackage(): - __gen_yield_result = safeds_runner.memoized_call("tests.generator.importsWithRunnerIntegration.impureFunction", impureFunction, [], []) + __gen_yield_result = safeds_runner.memoized_static_call("tests.generator.importsWithRunnerIntegration.impureFunction", impureFunction, [], []) return __gen_yield_result def segment2InSamePackage(): - __gen_yield_result = safeds_runner.memoized_call("tests.generator.importsWithRunnerIntegration.impureFunction", impureFunction, [], []) + __gen_yield_result = safeds_runner.memoized_static_call("tests.generator.importsWithRunnerIntegration.impureFunction", impureFunction, [], []) return __gen_yield_result diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_context_same_package.py.map b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_context_same_package.py.map index 139e58a8e..c401fa27d 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_context_same_package.py.map +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_context_same_package.py.map @@ -1 +1 @@ -{"version":3,"sources":["context same package.sdstest"],"names":["segment1insamepackage","result","impurefunction","segment2insamepackage"],"mappings":"AAAA;;;;;;;AAIA,IAAQA,qBAAqB;IACzB,YAAMC,MAAM,GAAG,2FAAAC,cAAc;IADD,OAAG;;AAInC,IAAQC,qBAAqB;IACzB,YAAMF,MAAM,GAAG,2FAAAC,cAAc;IADD,OAAG","file":"gen_context_same_package.py"} \ No newline at end of file +{"version":3,"sources":["context same package.sdstest"],"names":["segment1insamepackage","result","impurefunction","segment2insamepackage"],"mappings":"AAAA;;;;;;;AAIA,IAAQA,qBAAqB;IACzB,YAAMC,MAAM,GAAG,kGAAAC,cAAc;IADD,OAAG;;AAInC,IAAQC,qBAAqB;IACzB,YAAMF,MAAM,GAAG,kGAAAC,cAAc;IADD,OAAG","file":"gen_context_same_package.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_input.py b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_input.py index 44792b746..25eeba2d6 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_input.py +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_input.py @@ -13,11 +13,11 @@ def test(): f(segment1InSamePackage()) f(segment2InSamePackage()) f(segment2InSamePackage()) - f(safeds_runner.memoized_call("tests.generator.differentPackageWithRunnerIntegration.function1InDifferentPackage", function1InDifferentPackage, [], [])) - f(safeds_runner.memoized_call("tests.generator.differentPackageWithRunnerIntegration.function1InDifferentPackage", function1InDifferentPackage, [], [])) - f(safeds_runner.memoized_call("tests.generator.differentPackageWithRunnerIntegration.function2InDifferentPackage", g, [], [])) - f(safeds_runner.memoized_call("tests.generator.differentPackageWithRunnerIntegration.function2InDifferentPackage", g, [], [])) - f(safeds_runner.memoized_call("special_location.function1InCompilationUnitWithPythonModule", function1InCompilationUnitWithPythonModule, [], [])) - f(safeds_runner.memoized_call("special_location.function1InCompilationUnitWithPythonModule", function1InCompilationUnitWithPythonModule, [], [])) - f(safeds_runner.memoized_call("special_location.function2InCompilationUnitWithPythonModule", h, [], [])) - f(safeds_runner.memoized_call("special_location.function2InCompilationUnitWithPythonModule", h, [], [])) + f(safeds_runner.memoized_static_call("tests.generator.differentPackageWithRunnerIntegration.function1InDifferentPackage", function1InDifferentPackage, [], [])) + f(safeds_runner.memoized_static_call("tests.generator.differentPackageWithRunnerIntegration.function1InDifferentPackage", function1InDifferentPackage, [], [])) + f(safeds_runner.memoized_static_call("tests.generator.differentPackageWithRunnerIntegration.function2InDifferentPackage", g, [], [])) + f(safeds_runner.memoized_static_call("tests.generator.differentPackageWithRunnerIntegration.function2InDifferentPackage", g, [], [])) + f(safeds_runner.memoized_static_call("special_location.function1InCompilationUnitWithPythonModule", function1InCompilationUnitWithPythonModule, [], [])) + f(safeds_runner.memoized_static_call("special_location.function1InCompilationUnitWithPythonModule", function1InCompilationUnitWithPythonModule, [], [])) + f(safeds_runner.memoized_static_call("special_location.function2InCompilationUnitWithPythonModule", h, [], [])) + f(safeds_runner.memoized_static_call("special_location.function2InCompilationUnitWithPythonModule", h, [], [])) diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_input.py.map index 3d07d7a70..9c2d3b235 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_input.py.map +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/general/generated/tests/generator/importsWithRunnerIntegration/gen_input.py.map @@ -1 +1 @@ -{"version":3,"sources":["input.sdstest"],"names":["test","f","segment1insamepackage","segment2insamepackage","function1indifferentpackage","g","function1incompilationunitwithpythonmodule","h"],"mappings":"AAAA;;;;;;;;;;AASA,IAASA,IAAI;IACTC,CAAC,CAACC,qBAAqB;IACvBD,CAAC,CAACC,qBAAqB;IACvBD,CAAC,CAACE,qBAAqB;IACvBF,CAAC,CAACE,qBAAqB;IAEvBF,CAAC,CAAC,iHAAAG,2BAA2B;IAC7BH,CAAC,CAAC,iHAAAG,2BAA2B;IAC7BH,CAAC,CAAC,iHAAAI,CAAC;IACHJ,CAAC,CAAC,iHAAAI,CAAC;IAEHJ,CAAC,CAAC,2FAAAK,0CAA0C;IAC5CL,CAAC,CAAC,2FAAAK,0CAA0C;IAC5CL,CAAC,CAAC,2FAAAM,CAAC;IACHN,CAAC,CAAC,2FAAAM,CAAC","file":"gen_input.py"} \ No newline at end of file +{"version":3,"sources":["input.sdstest"],"names":["test","f","segment1insamepackage","segment2insamepackage","function1indifferentpackage","g","function1incompilationunitwithpythonmodule","h"],"mappings":"AAAA;;;;;;;;;;AASA,IAASA,IAAI;IACTC,CAAC,CAACC,qBAAqB;IACvBD,CAAC,CAACC,qBAAqB;IACvBD,CAAC,CAACE,qBAAqB;IACvBF,CAAC,CAACE,qBAAqB;IAEvBF,CAAC,CAAC,wHAAAG,2BAA2B;IAC7BH,CAAC,CAAC,wHAAAG,2BAA2B;IAC7BH,CAAC,CAAC,wHAAAI,CAAC;IACHJ,CAAC,CAAC,wHAAAI,CAAC;IAEHJ,CAAC,CAAC,kGAAAK,0CAA0C;IAC5CL,CAAC,CAAC,kGAAAK,0CAA0C;IAC5CL,CAAC,CAAC,kGAAAM,CAAC;IACHN,CAAC,CAAC,kGAAAM,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/wildcard/generated/tests/generator/wildcardWithRunnerIntegration/gen_input.py b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/wildcard/generated/tests/generator/wildcardWithRunnerIntegration/gen_input.py index ab76d62cc..dd23227f7 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/wildcard/generated/tests/generator/wildcardWithRunnerIntegration/gen_input.py +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/wildcard/generated/tests/generator/wildcardWithRunnerIntegration/gen_input.py @@ -8,11 +8,11 @@ # Pipelines -------------------------------------------------------------------- def test(): - f(safeds_runner.memoized_call("tests.generator.differentPackageWildcardWithRunnerIntegration.function1InDifferentPackage", function1InDifferentPackage, [], [])) - f(safeds_runner.memoized_call("tests.generator.differentPackageWildcardWithRunnerIntegration.function1InDifferentPackage", function1InDifferentPackage, [], [])) - f(safeds_runner.memoized_call("tests.generator.differentPackageWildcardWithRunnerIntegration.function2InDifferentPackage", function2InDifferentPackage, [], [])) - f(safeds_runner.memoized_call("tests.generator.differentPackageWildcardWithRunnerIntegration.function2InDifferentPackage", function2InDifferentPackage, [], [])) - f(safeds_runner.memoized_call("special_location.function1InCompilationUnitWithPythonModule", function1InCompilationUnitWithPythonModule, [], [])) - f(safeds_runner.memoized_call("special_location.function1InCompilationUnitWithPythonModule", function1InCompilationUnitWithPythonModule, [], [])) - f(safeds_runner.memoized_call("special_location.function2InCompilationUnitWithPythonModule", function2InCompilationUnitWithPythonModule, [], [])) - f(safeds_runner.memoized_call("special_location.function2InCompilationUnitWithPythonModule", function2InCompilationUnitWithPythonModule, [], [])) + f(safeds_runner.memoized_static_call("tests.generator.differentPackageWildcardWithRunnerIntegration.function1InDifferentPackage", function1InDifferentPackage, [], [])) + f(safeds_runner.memoized_static_call("tests.generator.differentPackageWildcardWithRunnerIntegration.function1InDifferentPackage", function1InDifferentPackage, [], [])) + f(safeds_runner.memoized_static_call("tests.generator.differentPackageWildcardWithRunnerIntegration.function2InDifferentPackage", function2InDifferentPackage, [], [])) + f(safeds_runner.memoized_static_call("tests.generator.differentPackageWildcardWithRunnerIntegration.function2InDifferentPackage", function2InDifferentPackage, [], [])) + f(safeds_runner.memoized_static_call("special_location.function1InCompilationUnitWithPythonModule", function1InCompilationUnitWithPythonModule, [], [])) + f(safeds_runner.memoized_static_call("special_location.function1InCompilationUnitWithPythonModule", function1InCompilationUnitWithPythonModule, [], [])) + f(safeds_runner.memoized_static_call("special_location.function2InCompilationUnitWithPythonModule", function2InCompilationUnitWithPythonModule, [], [])) + f(safeds_runner.memoized_static_call("special_location.function2InCompilationUnitWithPythonModule", function2InCompilationUnitWithPythonModule, [], [])) diff --git a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/wildcard/generated/tests/generator/wildcardWithRunnerIntegration/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/wildcard/generated/tests/generator/wildcardWithRunnerIntegration/gen_input.py.map index daef8e2ca..d3858f1fa 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/wildcard/generated/tests/generator/wildcardWithRunnerIntegration/gen_input.py.map +++ b/packages/safe-ds-lang/tests/resources/generation/python/runner integration/imports/wildcard/generated/tests/generator/wildcardWithRunnerIntegration/gen_input.py.map @@ -1 +1 @@ -{"version":3,"sources":["input.sdstest"],"names":["test","f","function1indifferentpackage","function2indifferentpackage","function1incompilationunitwithpythonmodule","function2incompilationunitwithpythonmodule"],"mappings":"AAAA;;;;;;;;;AAOA,IAASA,IAAI;IACTC,CAAC,CAAC,yHAAAC,2BAA2B;IAC7BD,CAAC,CAAC,yHAAAC,2BAA2B;IAC7BD,CAAC,CAAC,yHAAAE,2BAA2B;IAC7BF,CAAC,CAAC,yHAAAE,2BAA2B;IAE7BF,CAAC,CAAC,2FAAAG,0CAA0C;IAC5CH,CAAC,CAAC,2FAAAG,0CAA0C;IAC5CH,CAAC,CAAC,2FAAAI,0CAA0C;IAC5CJ,CAAC,CAAC,2FAAAI,0CAA0C","file":"gen_input.py"} \ No newline at end of file +{"version":3,"sources":["input.sdstest"],"names":["test","f","function1indifferentpackage","function2indifferentpackage","function1incompilationunitwithpythonmodule","function2incompilationunitwithpythonmodule"],"mappings":"AAAA;;;;;;;;;AAOA,IAASA,IAAI;IACTC,CAAC,CAAC,gIAAAC,2BAA2B;IAC7BD,CAAC,CAAC,gIAAAC,2BAA2B;IAC7BD,CAAC,CAAC,gIAAAE,2BAA2B;IAC7BF,CAAC,CAAC,gIAAAE,2BAA2B;IAE7BF,CAAC,CAAC,kGAAAG,0CAA0C;IAC5CH,CAAC,CAAC,kGAAAG,0CAA0C;IAC5CH,CAAC,CAAC,kGAAAI,0CAA0C;IAC5CJ,CAAC,CAAC,kGAAAI,0CAA0C","file":"gen_input.py"} \ No newline at end of file