From 9f133692960bda9426c23ffdabb8627356f5338f Mon Sep 17 00:00:00 2001 From: jgunstone Date: Mon, 22 Jan 2024 10:59:49 +0000 Subject: [PATCH] remove absolute paths to appdata from config files --- src/ipyrun/constants.py | 1 + .../examples/linegraph/linegraph/__main__.py | 36 ++--- .../examples/linegraph/linegraph_app.py | 14 +- src/ipyrun/runshell.py | 129 ++++++++++++------ src/ipyrun/runui.py | 4 +- tests/constants.py | 1 + .../00-linegraph/config-shell_handler.json | 8 +- .../00-linegraph/in-00-linegraph.lg.json | 7 +- .../00-linegraph/out-linegraph.csv | 70 ++++++---- .../00-linegraph/out-linegraph.plotly.json | 2 +- .../00-linegraph/config-shell_handler.json | 4 +- .../00-linegraph/in-00-linegraph.lg.json | 2 +- .../00-linegraph/out-linegraph.csv | 66 ++++----- .../00-linegraph/out-linegraph.plotly.json | 2 +- .../01-linegraph/config-shell_handler.json | 10 +- .../01-linegraph/out-linegraph.csv | 6 + .../01-linegraph/out-linegraph.plotly.json | 1 + .../config-shell_handler.json | 16 +-- tests/test_runshell.py | 24 ++++ 19 files changed, 258 insertions(+), 145 deletions(-) create mode 100644 tests/examples/line_graph_batch/01-linegraph/out-linegraph.csv create mode 100644 tests/examples/line_graph_batch/01-linegraph/out-linegraph.plotly.json diff --git a/src/ipyrun/constants.py b/src/ipyrun/constants.py index 7783630..e804f2a 100644 --- a/src/ipyrun/constants.py +++ b/src/ipyrun/constants.py @@ -20,6 +20,7 @@ FPTH_EXAMPLE_INPUTSCHEMA = PATH_PACKAGE / "examplerun" / "input_schema_linegraph.py" FPTH_EXAMPLE_RUN = PATH_PACKAGE / "examples" / "linegraph" / "linegraph" +PATH_PYTHONPATH_EXAMPLE = PATH_PACKAGE / "examples" / "linegraph" # default names of files in RunShell PATH_CONFIG = pathlib.Path("config-shell_handler.json") diff --git a/src/ipyrun/examples/linegraph/linegraph/__main__.py b/src/ipyrun/examples/linegraph/linegraph/__main__.py index 65ecf91..fdcb982 100644 --- a/src/ipyrun/examples/linegraph/linegraph/__main__.py +++ b/src/ipyrun/examples/linegraph/linegraph/__main__.py @@ -4,6 +4,7 @@ from .input_schema_linegraph import LineGraph from .make_graph import graph + def main(fpth_in, fpth_out_csv, fpth_out_plotly): """ Args: @@ -28,20 +29,21 @@ def main(fpth_in, fpth_out_csv, fpth_out_plotly): if __name__ == "__main__": - if __debug__: - import os - import pathlib - os.chdir(pathlib.Path(__file__).parent) - fpth_in = "inputs-line_graph.lg.json" - fpth_out_csv = "line_graph-output.csv" - fpth_out_plotly = "line_graph-output.plotly.json" - main(fpth_in, fpth_out_csv, fpth_out_plotly) - else: - import sys - fpth_in = sys.argv[1] - fpth_out_csv = sys.argv[2] - fpth_out_plotly = sys.argv[3] - print(f"fpth_in = {fpth_in}") - print(f"fpth_out_csv = {fpth_out_csv}") - print(f"fpth_out_plotly = {fpth_out_plotly}") - main(fpth_in, fpth_out_csv, fpth_out_plotly) + # if __debug__: + # import os + # import pathlib + # os.chdir(pathlib.Path(__file__).parent) + # fpth_in = "inputs-line_graph.lg.json" + # fpth_out_csv = "line_graph-output.csv" + # fpth_out_plotly = "line_graph-output.plotly.json" + # main(fpth_in, fpth_out_csv, fpth_out_plotly) + # else: + import sys + + fpth_in = sys.argv[1] + fpth_out_csv = sys.argv[2] + fpth_out_plotly = sys.argv[3] + print(f"fpth_in = {fpth_in}") + print(f"fpth_out_csv = {fpth_out_csv}") + print(f"fpth_out_plotly = {fpth_out_plotly}") + main(fpth_in, fpth_out_csv, fpth_out_plotly) diff --git a/src/ipyrun/examples/linegraph/linegraph_app.py b/src/ipyrun/examples/linegraph/linegraph_app.py index 796df64..55a14c8 100644 --- a/src/ipyrun/examples/linegraph/linegraph_app.py +++ b/src/ipyrun/examples/linegraph/linegraph_app.py @@ -12,9 +12,14 @@ PATH_INPUTSCHEMA = PATH_RUN / "input_schema_linegraph.py" class LineGraphConfigShell(DefaultConfigShell): + + @field_validator("pythonpath") + def _pythonpath(cls, v, info: ValidationInfo): + return pathlib.Path(__file__).parent + @field_validator("path_run") def _set_path_run(cls, v, info: ValidationInfo): - return PATH_RUN + return pathlib.Path("linegraph") @field_validator("fpths_outputs") def _fpths_outputs(cls, v, info: ValidationInfo): @@ -73,3 +78,10 @@ def _load_show(cls, v, info: ValidationInfo): return lambda: WorkingDirsUi( fn_onload=wrapped_partial(fn_loaddir_handler, app=info.data["app"]) ) + + @field_validator("outputs_show") + def _outputs_show(cls, v, info: ValidationInfo): + import functools + fdir = info.data["config"].fdir_root + fn = lambda fdir: print(fdir) + return functools.partial(fn, fdir) \ No newline at end of file diff --git a/src/ipyrun/runshell.py b/src/ipyrun/runshell.py index 245668b..8919436 100644 --- a/src/ipyrun/runshell.py +++ b/src/ipyrun/runshell.py @@ -8,7 +8,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.16.0 +# jupytext_version: 1.15.2 # kernelspec: # display_name: Python 3 (ipykernel) # language: python @@ -29,7 +29,7 @@ / "tests" / "examples" ) - FDIR_APPDATA = FDIR_TEST_EXAMPLES / "fdir_appdata" + FDIR_ROOT = FDIR_TEST_EXAMPLES / "fdir_appdata" # + # core libs @@ -205,6 +205,21 @@ def wrapped_partial(func, *args, **kwargs): return partial_func +# + +from math import cos, pi + +from pydantic import BaseModel, ImportString, ValidationError + + +class ImportThings(BaseModel): + obj: ImportString + + +# A string value will cause an automatic import +my_cos = ImportThings(obj="math.cos") +my_cos.model_dump(mode="json") + + # + class FiletypeEnum(str, Enum): input = "in" @@ -272,7 +287,7 @@ class ConfigShell(BaseModel): """ index: int = 0 - path_run: pathlib.Path = "script.py" + path_run: pathlib.Path = Field("script.py", validate_default=True) pythonpath: ty.Optional[pathlib.Path] = None run: ty.Optional[str] = None name: ty.Optional[str] = None @@ -284,6 +299,7 @@ class ConfigShell(BaseModel): "root folder. same as fdir_root within batch config." " facilitates running many processes. this is the working dir." ), + validate_default=True, ) fdir_appdata: ty.Optional[pathlib.Path] = Field(default=None) in_batch: bool = False @@ -299,9 +315,13 @@ class ConfigShell(BaseModel): default_factory=list, description="autoui definitions for displaying files. see ipyautoui", validate_default=True, - ) - autodisplay_inputs_kwargs: Dict = Field(default_factory=dict) - autodisplay_outputs_kwargs: Dict = Field(default_factory=dict) + ) # TODO: replace with import string + autodisplay_inputs_kwargs: Dict = Field( + default_factory=dict + ) # TODO: remove this. can use functools... + autodisplay_outputs_kwargs: Dict = Field( + default_factory=dict + ) # TODO: remove this. can use functools... fpths_inputs: Optional[List[pathlib.Path]] = None fpths_outputs: Optional[List[pathlib.Path]] = None fpth_params: ty.Optional[pathlib.Path] = None @@ -326,7 +346,8 @@ class ConfigShell(BaseModel): shell: str = "" -# - +# + +import sys class DefaultConfigShell(ConfigShell): @@ -383,28 +404,32 @@ def validate_path_run(cls, v): assert " " not in str(v.stem), "must be alphanumeric" return v - @field_validator("pythonpath") - def _pythonpath(cls, v, info: ValidationInfo): - # then we are executing a package rather than a script - # so we need to add the package to the PYTHONPATH - # TODO: Tasks pending completion -@jovyan at 9/29/2022, 9:31:39 AM - # this should append the parent to allow users to also specify - # a PYTHONPATH - v = info.data["path_run"].parent - return v + # @field_validator("pythonpath") + # def _pythonpath(cls, v, info: ValidationInfo): + # # then we are executing a package rather than a script + # # so we need to add the package to the PYTHONPATH + # # TODO: Tasks pending completion -@jovyan at 9/29/2022, 9:31:39 AM + # # this should append the parent to allow users to also specify + # # a PYTHONPATH + + # # TODO: add pythonpath to sys.path allowing import strings to work... + # # v = info.data["path_run"].parent + # return v @field_validator("run") def _run(cls, v, info: ValidationInfo): prun = pathlib.Path(info.data["path_run"]) - if prun.is_dir() or prun.is_file(): - # then we are executing a package rather than a script - # and we just assigned the PYTHONPATH - # so no we remove the parent to create the shell cmd + # if prun.is_dir() or prun.is_file(): + # # then we are executing a package rather than a script + # # and we just assigned the PYTHONPATH + # # so no we remove the parent to create the shell cmd + # v = prun.stem + # else: + # raise ValidationError( + # f"{str(prun)} must be python package dir or python script" + # ) + if isinstance(prun, pathlib.Path): v = prun.stem - else: - raise ValidationError( - f"{str(prun)} must be python package dir or python script" - ) return v @field_validator("name") @@ -439,6 +464,7 @@ def _fdir_root(cls, v, info: ValidationInfo): if v is None: v = pathlib.Path(".") os.chdir(str(v)) # TODO: this will fail if the code is run twice...? + v = pathlib.Path(".") return v # TODO: Tasks pending completion -@jovyan at 9/29/2022, 11:51:24 AM # rename to `cwd` @@ -505,19 +531,16 @@ def _params(cls, v, info: ValidationInfo): @field_validator("call") def _call(cls, v, info: ValidationInfo): - if "-m" not in str(v): - v = v + " -m" - if "python " in v and "/python " not in v: - import sys - - v = v.replace("python ", f"{sys.executable} ") - return v + return f"{sys.executable} -O -m" @field_validator("shell") def _shell(cls, v, info: ValidationInfo): return Template(info.data["shell_template"]).render(**info.data) +# - + + def udpate_env(append_to_pythonpath: str): env = os.environ.copy() if not "PYTHONPATH" in env.keys(): @@ -533,18 +556,32 @@ def run(config: Type[ConfigShell]): save = sys.stdout sys.stdout = io.StringIO() env = udpate_env(config.pythonpath) - proc = subprocess.check_output(config.shell, env=env, shell=True) + cwd = os.getcwd() + proc = subprocess.check_output(config.shell, env=env, shell=True, cwd=cwd) in_stdout = sys.stdout.getvalue() sys.stdout = save return proc if __name__ == "__main__": - from ipyrun.constants import FPTH_EXAMPLE_RUN + from ipyrun.constants import FPTH_EXAMPLE_RUN, PATH_PYTHONPATH_EXAMPLE - config = DefaultConfigShell(path_run=FPTH_EXAMPLE_RUN, fdir_root=FDIR_APPDATA) + FPTH_EXAMPLE_RUN = pathlib.Path(FPTH_EXAMPLE_RUN.stem) + + config = DefaultConfigShell( + path_run=FPTH_EXAMPLE_RUN, + fdir_root=FDIR_ROOT, + pythonpath=PATH_PYTHONPATH_EXAMPLE, + ) display(config.model_dump()) +# + +# from IPython.display import SVG + +# string_svg = '' +# SVG(string_svg) +# ^ remove HaloNotebook ? + # + def check(config: ConfigShell, fn_saveconfig): @@ -604,6 +641,7 @@ def run_shell(app=None, display_hide_btn=True): ) display(Markdown(f"{pr}")) spinner = HaloNotebook(animation="marquee", text="Running", spinner="dots") + # display(SVG(string_svg)) env = None if app.config.pythonpath is not None: env = udpate_env(app.config.pythonpath) @@ -618,7 +656,9 @@ def run_shell(app=None, display_hide_btn=True): display(in_stdout) spinner.succeed("Finished") except subprocess.CalledProcessError as e: + print("error") spinner.fail("Error with Process") + spinner.stop() app.actions.update_status() @@ -732,21 +772,31 @@ def _load_show(cls, v, info: ValidationInfo): if __name__ == "__main__": from ipyrun.constants import FPTH_EXAMPLE_RUN - config = DefaultConfigShell(path_run=FPTH_EXAMPLE_RUN, fdir_root=FDIR_APPDATA) + FPTH_EXAMPLE_RUN = pathlib.Path(FPTH_EXAMPLE_RUN.stem) + + config = DefaultConfigShell( + path_run=FPTH_EXAMPLE_RUN, + fdir_root=FDIR_ROOT, + pythonpath=PATH_PYTHONPATH_EXAMPLE, + ) display(config.model_dump()) if __name__ == "__main__": - config = DefaultConfigShell(path_run=FPTH_EXAMPLE_RUN, fdir_root=FDIR_APPDATA) + config = DefaultConfigShell(path_run=FPTH_EXAMPLE_RUN, fdir_root=FDIR_ROOT) actions = RunShellActions(config=config) - display(actions) + # display(actions) if __name__ == "__main__": from ipyrun.examples.linegraph.linegraph_app import LineGraphConfigShell - config = LineGraphConfigShell(fdir_root=FDIR_APPDATA) + config = LineGraphConfigShell(fdir_root=FDIR_ROOT) run_app = RunApp(config, cls_actions=RunShellActions) # cls_ui=RunUi, display(run_app) +if __name__ == "__main__": + print(run_app.config.pythonpath) + + if __name__ == "__main__": pr = run(config) @@ -795,6 +845,7 @@ def _fdir_root(cls, v, info: ValidationInfo): if v is None: v = pathlib.Path(".") os.chdir(str(v)) # TODO: this will fail if the code is run twice...? + v = pathlib.Path(".") return v @field_validator("cls_app") @@ -957,7 +1008,6 @@ def _get_loaded(cls, v, info: ValidationInfo): ) return fn - @field_validator("save_config") def _save_config(cls, v, info: ValidationInfo): return wrapped_partial( @@ -1057,7 +1107,6 @@ def _update_status(cls, v, info: ValidationInfo): display(app) # + - # TODO: use computed fields in the future... # from pydantic import BaseModel, computed_field diff --git a/src/ipyrun/runui.py b/src/ipyrun/runui.py index 5021f64..c7ac653 100644 --- a/src/ipyrun/runui.py +++ b/src/ipyrun/runui.py @@ -555,6 +555,7 @@ def _init_form(self): actions.help_ui_show = None run_ui.actions = actions +import pathlib class RunApp(widgets.HBox, RunUi): """ @@ -592,7 +593,8 @@ def _style_status(self): def __init__( self, - config: Any, + # fdir: pathlib.Path, # TODO: add this and make config all relative dirs. could be a fn to make it more general in the future + config: Any, # : RunConfig. TODO: not required. remove from dir cls_actions: Type[RunActions] = DefaultRunActions, ): """ diff --git a/tests/constants.py b/tests/constants.py index 069d841..50e2049 100644 --- a/tests/constants.py +++ b/tests/constants.py @@ -3,6 +3,7 @@ DIR_TESTS = pathlib.Path(__file__).parent DIR_EXAMPLE_PROCESS = DIR_TESTS / "examples" / "line_graph" FDIR_APPDATA = DIR_TESTS / "examples" / "fdir_appdata" +FDIR_APPDATA1 = DIR_TESTS / "examples" / "fdir_appdata1" PATH_EXAMPLE_SCRIPT = DIR_TESTS / "examples" / "script_line_graph.py" DIR_EXAMPLE_BATCH = DIR_TESTS / "examples" / "line_graph_batch" diff --git a/tests/examples/fdir_appdata/00-linegraph/config-shell_handler.json b/tests/examples/fdir_appdata/00-linegraph/config-shell_handler.json index 7d28965..c8bce26 100644 --- a/tests/examples/fdir_appdata/00-linegraph/config-shell_handler.json +++ b/tests/examples/fdir_appdata/00-linegraph/config-shell_handler.json @@ -1,12 +1,12 @@ { "index": 0, - "path_run": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph/linegraph", + "path_run": "linegraph", "pythonpath": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph", "run": "linegraph", "name": "linegraph", "long_name": "00 - Linegraph", "key": "00-linegraph", - "fdir_root": "/home/jovyan/ipyrun/tests/examples/fdir_appdata", + "fdir_root": ".", "fdir_appdata": "00-linegraph", "in_batch": false, "status": "up_to_date", @@ -37,8 +37,8 @@ "fpth_config": "00-linegraph/config-shell_handler.json", "fpth_runhistory": "00-linegraph/runhistory.csv", "fpth_log": "00-linegraph/log.csv", - "call": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python -O -m", + "call": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python -m -O", "params": {}, "shell_template": "{{ call }} {{ run }}{% for f in fpths_inputs %} {{f}}{% endfor %}{% for f in fpths_outputs %} {{f}}{% endfor %}{% for k,v in params.items()%} --{{k}} {{v}}{% endfor %}\n", - "shell": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python -O -m linegraph 00-linegraph/in-00-linegraph.lg.json 00-linegraph/out-linegraph.csv 00-linegraph/out-linegraph.plotly.json" + "shell": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python -m -O linegraph 00-linegraph/in-00-linegraph.lg.json 00-linegraph/out-linegraph.csv 00-linegraph/out-linegraph.plotly.json" } \ No newline at end of file diff --git a/tests/examples/fdir_appdata/00-linegraph/in-00-linegraph.lg.json b/tests/examples/fdir_appdata/00-linegraph/in-00-linegraph.lg.json index 6e75e50..84f4813 100644 --- a/tests/examples/fdir_appdata/00-linegraph/in-00-linegraph.lg.json +++ b/tests/examples/fdir_appdata/00-linegraph/in-00-linegraph.lg.json @@ -1,14 +1,13 @@ { "title": "lines", - "m": 4.0, + "m": 0.0, "c": 5.0, "x_range": [ 0, - 28 + 44 ], "y_range": [ 0, 5 - ], - "references": {} + ] } \ No newline at end of file diff --git a/tests/examples/fdir_appdata/00-linegraph/out-linegraph.csv b/tests/examples/fdir_appdata/00-linegraph/out-linegraph.csv index d486edf..d91ff7c 100644 --- a/tests/examples/fdir_appdata/00-linegraph/out-linegraph.csv +++ b/tests/examples/fdir_appdata/00-linegraph/out-linegraph.csv @@ -1,29 +1,45 @@ ,x,y 0,0,5.0 -1,1,9.0 -2,2,13.0 -3,3,17.0 -4,4,21.0 -5,5,25.0 -6,6,29.0 -7,7,33.0 -8,8,37.0 -9,9,41.0 -10,10,45.0 -11,11,49.0 -12,12,53.0 -13,13,57.0 -14,14,61.0 -15,15,65.0 -16,16,69.0 -17,17,73.0 -18,18,77.0 -19,19,81.0 -20,20,85.0 -21,21,89.0 -22,22,93.0 -23,23,97.0 -24,24,101.0 -25,25,105.0 -26,26,109.0 -27,27,113.0 +1,1,5.0 +2,2,5.0 +3,3,5.0 +4,4,5.0 +5,5,5.0 +6,6,5.0 +7,7,5.0 +8,8,5.0 +9,9,5.0 +10,10,5.0 +11,11,5.0 +12,12,5.0 +13,13,5.0 +14,14,5.0 +15,15,5.0 +16,16,5.0 +17,17,5.0 +18,18,5.0 +19,19,5.0 +20,20,5.0 +21,21,5.0 +22,22,5.0 +23,23,5.0 +24,24,5.0 +25,25,5.0 +26,26,5.0 +27,27,5.0 +28,28,5.0 +29,29,5.0 +30,30,5.0 +31,31,5.0 +32,32,5.0 +33,33,5.0 +34,34,5.0 +35,35,5.0 +36,36,5.0 +37,37,5.0 +38,38,5.0 +39,39,5.0 +40,40,5.0 +41,41,5.0 +42,42,5.0 +43,43,5.0 diff --git a/tests/examples/fdir_appdata/00-linegraph/out-linegraph.plotly.json b/tests/examples/fdir_appdata/00-linegraph/out-linegraph.plotly.json index 36af2fc..4b02216 100644 --- a/tests/examples/fdir_appdata/00-linegraph/out-linegraph.plotly.json +++ b/tests/examples/fdir_appdata/00-linegraph/out-linegraph.plotly.json @@ -1 +1 @@ -{"data":[{"hovertemplate":"x=%{x}
y=%{y}","legendgroup":"","line":{"color":"#636efa","dash":"solid"},"marker":{"symbol":"circle"},"mode":"lines","name":"","orientation":"v","showlegend":false,"x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27],"xaxis":"x","y":[5.0,9.0,13.0,17.0,21.0,25.0,29.0,33.0,37.0,41.0,45.0,49.0,53.0,57.0,61.0,65.0,69.0,73.0,77.0,81.0,85.0,89.0,93.0,97.0,101.0,105.0,109.0,113.0],"yaxis":"y","type":"scatter"}],"layout":{"template":{"data":{"barpolar":[{"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"white","showlakes":true,"showland":true,"subunitcolor":"#C8D4E3"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"white","polar":{"angularaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""},"bgcolor":"white","radialaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"yaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"zaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"baxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"bgcolor":"white","caxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"x"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"y"}},"legend":{"tracegroupgap":0},"title":{"text":"lines
y = 4.0 * x + 5.0"}}} \ No newline at end of file +{"data":[{"hovertemplate":"x=%{x}
y=%{y}","legendgroup":"","line":{"color":"#636efa","dash":"solid"},"marker":{"symbol":"circle"},"mode":"lines","name":"","orientation":"v","showlegend":false,"x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"xaxis":"x","y":[5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0],"yaxis":"y","type":"scatter"}],"layout":{"template":{"data":{"barpolar":[{"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"white","showlakes":true,"showland":true,"subunitcolor":"#C8D4E3"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"white","polar":{"angularaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""},"bgcolor":"white","radialaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"yaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"zaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"baxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"bgcolor":"white","caxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"x"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"y"}},"legend":{"tracegroupgap":0},"title":{"text":"lines
y = 0.0 * x + 5.0"}}} \ No newline at end of file diff --git a/tests/examples/line_graph_batch/00-linegraph/config-shell_handler.json b/tests/examples/line_graph_batch/00-linegraph/config-shell_handler.json index 54c78b4..8e32b14 100644 --- a/tests/examples/line_graph_batch/00-linegraph/config-shell_handler.json +++ b/tests/examples/line_graph_batch/00-linegraph/config-shell_handler.json @@ -1,12 +1,12 @@ { "index": 0, - "path_run": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph/linegraph", + "path_run": "linegraph", "pythonpath": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph", "run": "linegraph", "name": "linegraph", "long_name": "00 - Linegraph", "key": "00-linegraph", - "fdir_root": "/home/jovyan/ipyrun/tests/examples/line_graph_batch", + "fdir_root": ".", "fdir_appdata": "00-linegraph", "in_batch": true, "status": "up_to_date", diff --git a/tests/examples/line_graph_batch/00-linegraph/in-00-linegraph.lg.json b/tests/examples/line_graph_batch/00-linegraph/in-00-linegraph.lg.json index ff4a939..c611032 100644 --- a/tests/examples/line_graph_batch/00-linegraph/in-00-linegraph.lg.json +++ b/tests/examples/line_graph_batch/00-linegraph/in-00-linegraph.lg.json @@ -1 +1 @@ -{"title": "test - 0a6b4a2f-4ca5-42bb-9afc-3e0e6b05c4d1", "m": 3.0, "c": 6.0, "x_range": [0, 34], "y_range": [0, 5]} \ No newline at end of file +{"title": "test - 9ae25698-3e45-4795-bec0-6810db97d45e", "m": 4.0, "c": 6.0, "x_range": [0, 34], "y_range": [0, 5]} \ No newline at end of file diff --git a/tests/examples/line_graph_batch/00-linegraph/out-linegraph.csv b/tests/examples/line_graph_batch/00-linegraph/out-linegraph.csv index 9be0b87..82e95ee 100644 --- a/tests/examples/line_graph_batch/00-linegraph/out-linegraph.csv +++ b/tests/examples/line_graph_batch/00-linegraph/out-linegraph.csv @@ -1,35 +1,35 @@ ,x,y 0,0,6.0 -1,1,9.0 -2,2,12.0 -3,3,15.0 -4,4,18.0 -5,5,21.0 -6,6,24.0 -7,7,27.0 -8,8,30.0 -9,9,33.0 -10,10,36.0 -11,11,39.0 -12,12,42.0 -13,13,45.0 -14,14,48.0 -15,15,51.0 -16,16,54.0 -17,17,57.0 -18,18,60.0 -19,19,63.0 -20,20,66.0 -21,21,69.0 -22,22,72.0 -23,23,75.0 -24,24,78.0 -25,25,81.0 -26,26,84.0 -27,27,87.0 -28,28,90.0 -29,29,93.0 -30,30,96.0 -31,31,99.0 -32,32,102.0 -33,33,105.0 +1,1,10.0 +2,2,14.0 +3,3,18.0 +4,4,22.0 +5,5,26.0 +6,6,30.0 +7,7,34.0 +8,8,38.0 +9,9,42.0 +10,10,46.0 +11,11,50.0 +12,12,54.0 +13,13,58.0 +14,14,62.0 +15,15,66.0 +16,16,70.0 +17,17,74.0 +18,18,78.0 +19,19,82.0 +20,20,86.0 +21,21,90.0 +22,22,94.0 +23,23,98.0 +24,24,102.0 +25,25,106.0 +26,26,110.0 +27,27,114.0 +28,28,118.0 +29,29,122.0 +30,30,126.0 +31,31,130.0 +32,32,134.0 +33,33,138.0 diff --git a/tests/examples/line_graph_batch/00-linegraph/out-linegraph.plotly.json b/tests/examples/line_graph_batch/00-linegraph/out-linegraph.plotly.json index 9a65df6..1bde62c 100644 --- a/tests/examples/line_graph_batch/00-linegraph/out-linegraph.plotly.json +++ b/tests/examples/line_graph_batch/00-linegraph/out-linegraph.plotly.json @@ -1 +1 @@ -{"data":[{"hovertemplate":"x=%{x}
y=%{y}","legendgroup":"","line":{"color":"#636efa","dash":"solid"},"marker":{"symbol":"circle"},"mode":"lines","name":"","orientation":"v","showlegend":false,"x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"xaxis":"x","y":[6.0,9.0,12.0,15.0,18.0,21.0,24.0,27.0,30.0,33.0,36.0,39.0,42.0,45.0,48.0,51.0,54.0,57.0,60.0,63.0,66.0,69.0,72.0,75.0,78.0,81.0,84.0,87.0,90.0,93.0,96.0,99.0,102.0,105.0],"yaxis":"y","type":"scatter"}],"layout":{"template":{"data":{"barpolar":[{"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"white","showlakes":true,"showland":true,"subunitcolor":"#C8D4E3"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"white","polar":{"angularaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""},"bgcolor":"white","radialaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"yaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"zaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"baxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"bgcolor":"white","caxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"x"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"y"}},"legend":{"tracegroupgap":0},"title":{"text":"test - 0a6b4a2f-4ca5-42bb-9afc-3e0e6b05c4d1
y = 3.0 * x + 6.0"}}} \ No newline at end of file +{"data":[{"hovertemplate":"x=%{x}
y=%{y}","legendgroup":"","line":{"color":"#636efa","dash":"solid"},"marker":{"symbol":"circle"},"mode":"lines","name":"","orientation":"v","showlegend":false,"x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"xaxis":"x","y":[6.0,10.0,14.0,18.0,22.0,26.0,30.0,34.0,38.0,42.0,46.0,50.0,54.0,58.0,62.0,66.0,70.0,74.0,78.0,82.0,86.0,90.0,94.0,98.0,102.0,106.0,110.0,114.0,118.0,122.0,126.0,130.0,134.0,138.0],"yaxis":"y","type":"scatter"}],"layout":{"template":{"data":{"barpolar":[{"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"white","showlakes":true,"showland":true,"subunitcolor":"#C8D4E3"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"white","polar":{"angularaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""},"bgcolor":"white","radialaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"yaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"zaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"baxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"bgcolor":"white","caxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"x"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"y"}},"legend":{"tracegroupgap":0},"title":{"text":"test - 9ae25698-3e45-4795-bec0-6810db97d45e
y = 4.0 * x + 6.0"}}} \ No newline at end of file diff --git a/tests/examples/line_graph_batch/01-linegraph/config-shell_handler.json b/tests/examples/line_graph_batch/01-linegraph/config-shell_handler.json index 651e013..8b8bfb8 100644 --- a/tests/examples/line_graph_batch/01-linegraph/config-shell_handler.json +++ b/tests/examples/line_graph_batch/01-linegraph/config-shell_handler.json @@ -1,15 +1,15 @@ { "index": 1, - "path_run": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph/linegraph", + "path_run": "linegraph", "pythonpath": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph", "run": "linegraph", "name": "linegraph", "long_name": "01 - Linegraph", "key": "01-linegraph", - "fdir_root": "/home/jovyan/ipyrun/tests/examples/line_graph_batch", + "fdir_root": ".", "fdir_appdata": "01-linegraph", "in_batch": false, - "status": "no_outputs", + "status": "up_to_date", "update_config_at_runtime": false, "autodisplay_definitions": [ { @@ -37,8 +37,8 @@ "fpth_config": "01-linegraph/config-shell_handler.json", "fpth_runhistory": "01-linegraph/runhistory.csv", "fpth_log": "01-linegraph/log.csv", - "call": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python3.11 -O -m", + "call": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python -O -m", "params": {}, "shell_template": "{{ call }} {{ run }}{% for f in fpths_inputs %} {{f}}{% endfor %}{% for f in fpths_outputs %} {{f}}{% endfor %}{% for k,v in params.items()%} --{{k}} {{v}}{% endfor %}\n", - "shell": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python3.11 -O -m linegraph 01-linegraph/in-01-linegraph.lg.json 01-linegraph/out-linegraph.csv 01-linegraph/out-linegraph.plotly.json" + "shell": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python -O -m linegraph 01-linegraph/in-01-linegraph.lg.json 01-linegraph/out-linegraph.csv 01-linegraph/out-linegraph.plotly.json" } \ No newline at end of file diff --git a/tests/examples/line_graph_batch/01-linegraph/out-linegraph.csv b/tests/examples/line_graph_batch/01-linegraph/out-linegraph.csv new file mode 100644 index 0000000..2f64b7f --- /dev/null +++ b/tests/examples/line_graph_batch/01-linegraph/out-linegraph.csv @@ -0,0 +1,6 @@ +,x,y +0,0,5.0 +1,1,7.0 +2,2,9.0 +3,3,11.0 +4,4,13.0 diff --git a/tests/examples/line_graph_batch/01-linegraph/out-linegraph.plotly.json b/tests/examples/line_graph_batch/01-linegraph/out-linegraph.plotly.json new file mode 100644 index 0000000..d3a8e5b --- /dev/null +++ b/tests/examples/line_graph_batch/01-linegraph/out-linegraph.plotly.json @@ -0,0 +1 @@ +{"data":[{"hovertemplate":"x=%{x}
y=%{y}","legendgroup":"","line":{"color":"#636efa","dash":"solid"},"marker":{"symbol":"circle"},"mode":"lines","name":"","orientation":"v","showlegend":false,"x":[0,1,2,3,4],"xaxis":"x","y":[5.0,7.0,9.0,11.0,13.0],"yaxis":"y","type":"scatter"}],"layout":{"template":{"data":{"barpolar":[{"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"heatmapgl":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmapgl"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"white","showlakes":true,"showland":true,"subunitcolor":"#C8D4E3"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"paper_bgcolor":"white","plot_bgcolor":"white","polar":{"angularaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""},"bgcolor":"white","radialaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"yaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"zaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"baxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"bgcolor":"white","caxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"x"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"y"}},"legend":{"tracegroupgap":0},"title":{"text":"line equation
y = 2.0 * x + 5.0"}}} \ No newline at end of file diff --git a/tests/examples/line_graph_batch/config-shell_handler.json b/tests/examples/line_graph_batch/config-shell_handler.json index 89a19a0..9958735 100644 --- a/tests/examples/line_graph_batch/config-shell_handler.json +++ b/tests/examples/line_graph_batch/config-shell_handler.json @@ -1,18 +1,18 @@ { - "fdir_root": "/home/jovyan/ipyrun/tests/examples/line_graph_batch", + "fdir_root": ".", "fpth_config": "config-shell_handler.json", "title": "# Plot Straight Lines\n### example RunApp", "status": null, "configs": [ { "index": 0, - "path_run": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph/linegraph", + "path_run": "linegraph", "pythonpath": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph", "run": "linegraph", "name": "linegraph", "long_name": "00 - Linegraph", "key": "00-linegraph", - "fdir_root": "/home/jovyan/ipyrun/tests/examples/line_graph_batch", + "fdir_root": ".", "fdir_appdata": "00-linegraph", "in_batch": true, "status": "up_to_date", @@ -50,16 +50,16 @@ }, { "index": 1, - "path_run": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph/linegraph", + "path_run": "linegraph", "pythonpath": "/home/jovyan/ipyrun/src/ipyrun/examples/linegraph", "run": "linegraph", "name": "linegraph", "long_name": "01 - Linegraph", "key": "01-linegraph", - "fdir_root": "/home/jovyan/ipyrun/tests/examples/line_graph_batch", + "fdir_root": ".", "fdir_appdata": "01-linegraph", "in_batch": false, - "status": "no_outputs", + "status": "up_to_date", "update_config_at_runtime": false, "autodisplay_definitions": [ { @@ -87,10 +87,10 @@ "fpth_config": "01-linegraph/config-shell_handler.json", "fpth_runhistory": "01-linegraph/runhistory.csv", "fpth_log": "01-linegraph/log.csv", - "call": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python3.11 -O -m", + "call": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python -O -m", "params": {}, "shell_template": "{{ call }} {{ run }}{% for f in fpths_inputs %} {{f}}{% endfor %}{% for f in fpths_outputs %} {{f}}{% endfor %}{% for k,v in params.items()%} --{{k}} {{v}}{% endfor %}\n", - "shell": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python3.11 -O -m linegraph 01-linegraph/in-01-linegraph.lg.json 01-linegraph/out-linegraph.csv 01-linegraph/out-linegraph.plotly.json" + "shell": "/home/jovyan/micromamba/envs/ipyrun-dev/bin/python -O -m linegraph 01-linegraph/in-01-linegraph.lg.json 01-linegraph/out-linegraph.csv 01-linegraph/out-linegraph.plotly.json" } ] } \ No newline at end of file diff --git a/tests/test_runshell.py b/tests/test_runshell.py index 578e268..f9cc56f 100644 --- a/tests/test_runshell.py +++ b/tests/test_runshell.py @@ -11,6 +11,7 @@ DIR_EXAMPLE_APPDATA, DIR_EXAMPLE_PROCESS, FDIR_APPDATA, + FDIR_APPDATA1, ) from datetime import datetime import subprocess @@ -108,6 +109,9 @@ def remake_config(): file(config_batch, config_batch.fpth_config) +import os + + def test_runapp(): """Test something.""" @@ -115,9 +119,29 @@ def test_runapp(): path_run=FPTH_EXAMPLE_SCRIPT, fdir_root=FDIR_APPDATA, ) + assert os.getcwd() == str(FDIR_APPDATA) + pr = run(config) + print("config") + assert isinstance(config, ConfigShell) + + +import shutil +import time + + +def test_runapp_portable(): + """Test something.""" + shutil.copytree(FDIR_APPDATA, FDIR_APPDATA1) + time.sleep(2) + config = LineGraphConfigShell( + path_run=FPTH_EXAMPLE_SCRIPT, + fdir_root=FDIR_APPDATA1, + ) + assert os.getcwd() == str(FDIR_APPDATA1) pr = run(config) print("config") assert isinstance(config, ConfigShell) + shutil.rmtree(FDIR_APPDATA1) # TODO: update example to this: https://examples.pyviz.org/attractors/attractors.html