Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

refactor: rename from observations.dvs/ivs to data.conditions/observations #15

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
260eafd
fix: add corrected aliases for observations and conditions
hollandjg Jun 27, 2023
bdf650c
deps: upgrade autora-core (to allow for new deprecate decorator)
hollandjg Jun 28, 2023
300b8b7
deprecate: add deprecation warnings to old parameter calls
hollandjg Jun 28, 2023
4788178
refactor: use new version of autora core with updated deprecation fun…
hollandjg Jul 3, 2023
6cb861f
test: update tests
hollandjg Jul 3, 2023
6838df8
refactor: rename data -> experiment_data
hollandjg Jul 5, 2023
8419dd4
test: update test results
hollandjg Jul 5, 2023
2b5ed10
refactor: rename data -> experiment_data
hollandjg Jul 5, 2023
718985d
Merge branch '19-test-update-usages-of-sampler-sample' into 14-state-…
hollandjg Jul 6, 2023
d0f7236
chore: clear outputs
hollandjg Jul 6, 2023
40c9eb8
chore: clear outputs
hollandjg Jul 6, 2023
06bf620
docs: update examples of using state dependent properties
hollandjg Jul 6, 2023
0669e17
Merge branch 'main' into 14-state-dependent-properties-of-workflow-ne…
hollandjg Jul 6, 2023
6ca0d81
Update src/autora/workflow/state/param.py
hollandjg Jul 6, 2023
3fee0fa
Update src/autora/workflow/state/param.py
hollandjg Jul 6, 2023
b537ec3
Update src/autora/workflow/state/param.py
hollandjg Jul 6, 2023
36b4ed7
Update src/autora/workflow/state/param.py
hollandjg Jul 6, 2023
b4e3c9a
docs: update examples of using state dependent properties
hollandjg Jul 6, 2023
0328e4a
Merge remote-tracking branch 'origin/14-state-dependent-properties-of…
hollandjg Jul 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 18 additions & 27 deletions docs/interactive/Accessing State Dependent Properties.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"dictionary. These are the following strings, which will be replaced during execution by\n",
"their respective current values:\n",
"\n",
"- `\"%observations.ivs[-1]%\"`: the last observed independent variables\n",
"- `\"%observations.dvs[-1]%\"`: the last observed dependent variables\n",
"- `\"%observations.ivs%\"`: all the observed independent variables,\n",
"- `\"%experiment_data.conditions[-1]%\"`: the last observed independent variables\n",
"- `\"%experiment_data.observations[-1]%\"`: the last observed dependent variables\n",
"- `\"%experiment_data.conditions%\"`: all the observed independent variables,\n",
"concatenated into a single array\n",
"- `\"%observations.dvs%\"`: all the observed dependent variables,\n",
"- `\"%experiment_data.observations%\"`: all the observed dependent variables,\n",
"concatenated into a single array\n",
"- `\"%models[-1]%\"`: the last fitted theorist\n",
"- `\"%models%\"`: all the fitted theorists\n",
Expand Down Expand Up @@ -101,7 +101,7 @@
" experiment_runner=example_synthetic_experiment_runner,\n",
" params={\n",
" \"experimentalist\": {\n",
" \"exclude_conditions\": {\"excluded_conditions\": \"%observations.ivs%\"},\n",
" \"exclude_conditions\": {\"excluded_conditions\": \"%experiment_data.conditions%\"},\n",
" \"custom_random_sampler\": {\"n\": 1}\n",
" }\n",
" }\n",
Expand Down Expand Up @@ -245,32 +245,23 @@
"evalue": "a cannot be empty unless no samples are taken",
"output_type": "error",
"traceback": [
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
"\u001B[0;31mValueError\u001B[0m Traceback (most recent call last)",
"Cell \u001B[0;32mIn[5], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[43mcycle_with_state_dep_properties\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mrun\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m \u001B[38;5;66;03m# doctest: +ELLIPSIS\u001B[39;00m\n",
"File \u001B[0;32m~/Developer/autora-workflow/src/autora/workflow/cycle.py:82\u001B[0m, in \u001B[0;36mCycle.run\u001B[0;34m(self, num_cycles)\u001B[0m\n\u001B[1;32m 80\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mrun\u001B[39m(\u001B[38;5;28mself\u001B[39m, num_cycles: \u001B[38;5;28mint\u001B[39m \u001B[38;5;241m=\u001B[39m \u001B[38;5;241m1\u001B[39m):\n\u001B[1;32m 81\u001B[0m \u001B[38;5;250m \u001B[39m\u001B[38;5;124;03m\"\"\"Execute the next step in the cycle.\"\"\"\u001B[39;00m\n\u001B[0;32m---> 82\u001B[0m \u001B[38;5;28;43msuper\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mrun\u001B[49m\u001B[43m(\u001B[49m\u001B[43mnum_steps\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mnum_cycles\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 83\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\n",
"File \u001B[0;32m~/Developer/autora-workflow/src/autora/workflow/base.py:85\u001B[0m, in \u001B[0;36mBaseController.run\u001B[0;34m(self, num_steps)\u001B[0m\n\u001B[1;32m 83\u001B[0m \u001B[38;5;250m\u001B[39m\u001B[38;5;124;03m\"\"\"Run the next num_steps planned steps in the workflow.\"\"\"\u001B[39;00m\n\u001B[1;32m 84\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m i \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28mrange\u001B[39m(num_steps):\n\u001B[0;32m---> 85\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mrun_once\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 86\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\n",
"File \u001B[0;32m~/Developer/autora-workflow/src/autora/workflow/base.py:71\u001B[0m, in \u001B[0;36mBaseController.run_once\u001B[0;34m(self, step_name)\u001B[0m\n\u001B[1;32m 68\u001B[0m _logger\u001B[38;5;241m.\u001B[39mdebug(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mnext_params\u001B[38;5;132;01m=}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m)\n\u001B[1;32m 70\u001B[0m \u001B[38;5;66;03m# Execute\u001B[39;00m\n\u001B[0;32m---> 71\u001B[0m result \u001B[38;5;241m=\u001B[39m \u001B[43mnext_function\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mstate\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mparams\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mnext_params\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 72\u001B[0m _logger\u001B[38;5;241m.\u001B[39mdebug(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mresult\u001B[38;5;132;01m=}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m)\n\u001B[1;32m 74\u001B[0m \u001B[38;5;66;03m# Update\u001B[39;00m\n",
"File \u001B[0;32m~/Developer/autora-workflow/src/autora/workflow/executor.py:174\u001B[0m, in \u001B[0;36mfull_cycle_wrapper.<locals>._executor_full_cycle\u001B[0;34m(state, params)\u001B[0m\n\u001B[1;32m 169\u001B[0m experimentalist_params \u001B[38;5;241m=\u001B[39m params\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mexperimentalist\u001B[39m\u001B[38;5;124m\"\u001B[39m, {})\n\u001B[1;32m 171\u001B[0m experimentalist_executor \u001B[38;5;241m=\u001B[39m from_experimentalist_pipeline(\n\u001B[1;32m 172\u001B[0m experimentalist_pipeline\n\u001B[1;32m 173\u001B[0m )\n\u001B[0;32m--> 174\u001B[0m experimentalist_result \u001B[38;5;241m=\u001B[39m \u001B[43mexperimentalist_executor\u001B[49m\u001B[43m(\u001B[49m\u001B[43mstate\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mexperimentalist_params\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 176\u001B[0m experiment_runner_params \u001B[38;5;241m=\u001B[39m params\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mexperiment_runner\u001B[39m\u001B[38;5;124m\"\u001B[39m, {})\n\u001B[1;32m 177\u001B[0m experiment_runner_executor \u001B[38;5;241m=\u001B[39m from_experiment_runner_callable(\n\u001B[1;32m 178\u001B[0m experiment_runner_callable\n\u001B[1;32m 179\u001B[0m )\n",
"File \u001B[0;32m~/Developer/autora-workflow/src/autora/workflow/executor.py:64\u001B[0m, in \u001B[0;36mfrom_experimentalist_pipeline.<locals>._executor_experimentalist\u001B[0;34m(state, params)\u001B[0m\n\u001B[1;32m 62\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21m_executor_experimentalist\u001B[39m(state: SupportsControllerState, params: Dict):\n\u001B[1;32m 63\u001B[0m params_ \u001B[38;5;241m=\u001B[39m resolve_state_params(params, state)\n\u001B[0;32m---> 64\u001B[0m new_conditions \u001B[38;5;241m=\u001B[39m \u001B[43mpipeline\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mparams_\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 66\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(new_conditions, pd\u001B[38;5;241m.\u001B[39mDataFrame):\n\u001B[1;32m 67\u001B[0m new_conditions_array \u001B[38;5;241m=\u001B[39m new_conditions\n",
"File \u001B[0;32m~/Developer/autora-workflow/venv/lib/python3.10/site-packages/autora/experimentalist/pipeline.py:171\u001B[0m, in \u001B[0;36mPipeline.__call__\u001B[0;34m(self, ex, **params)\u001B[0m\n\u001B[1;32m 169\u001B[0m \u001B[38;5;28;01massert\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(pipe, Pipe)\n\u001B[1;32m 170\u001B[0m all_params_for_pipe \u001B[38;5;241m=\u001B[39m merged_params\u001B[38;5;241m.\u001B[39mget(name, \u001B[38;5;28mdict\u001B[39m())\n\u001B[0;32m--> 171\u001B[0m results\u001B[38;5;241m.\u001B[39mappend(\u001B[43mpipe\u001B[49m\u001B[43m(\u001B[49m\u001B[43mresults\u001B[49m\u001B[43m[\u001B[49m\u001B[38;5;241;43m-\u001B[39;49m\u001B[38;5;241;43m1\u001B[39;49m\u001B[43m]\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mall_params_for_pipe\u001B[49m\u001B[43m)\u001B[49m)\n\u001B[1;32m 173\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m results[\u001B[38;5;241m-\u001B[39m\u001B[38;5;241m1\u001B[39m]\n",
"Cell \u001B[0;32mIn[2], line 9\u001B[0m, in \u001B[0;36mcustom_random_sampler\u001B[0;34m(conditions, n)\u001B[0m\n\u001B[1;32m 8\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mcustom_random_sampler\u001B[39m(conditions, n):\n\u001B[0;32m----> 9\u001B[0m sampled_conditions \u001B[38;5;241m=\u001B[39m \u001B[43mrandom_sampler_rng\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mchoice\u001B[49m\u001B[43m(\u001B[49m\u001B[43mconditions\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43msize\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mn\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mreplace\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43;01mFalse\u001B[39;49;00m\u001B[43m)\u001B[49m\n\u001B[1;32m 10\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m sampled_conditions\n",
"File \u001B[0;32m_generator.pyx:729\u001B[0m, in \u001B[0;36mnumpy.random._generator.Generator.choice\u001B[0;34m()\u001B[0m\n",
"\u001B[0;31mValueError\u001B[0m: a cannot be empty unless no samples are taken"
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[6], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mcycle_with_state_dep_properties\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/Developer/autora-workflow/src/autora/workflow/cycle.py:82\u001b[0m, in \u001b[0;36mCycle.run\u001b[0;34m(self, num_cycles)\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mrun\u001b[39m(\u001b[38;5;28mself\u001b[39m, num_cycles: \u001b[38;5;28mint\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m):\n\u001b[1;32m 81\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Execute the next step in the cycle.\"\"\"\u001b[39;00m\n\u001b[0;32m---> 82\u001b[0m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnum_steps\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnum_cycles\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 83\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\n",
"File \u001b[0;32m~/Developer/autora-workflow/src/autora/workflow/base.py:85\u001b[0m, in \u001b[0;36mBaseController.run\u001b[0;34m(self, num_steps)\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Run the next num_steps planned steps in the workflow.\"\"\"\u001b[39;00m\n\u001b[1;32m 84\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(num_steps):\n\u001b[0;32m---> 85\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun_once\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 86\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\n",
"File \u001b[0;32m~/Developer/autora-workflow/src/autora/workflow/base.py:71\u001b[0m, in \u001b[0;36mBaseController.run_once\u001b[0;34m(self, step_name)\u001b[0m\n\u001b[1;32m 68\u001b[0m _logger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mnext_params\u001b[38;5;132;01m=}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 70\u001b[0m \u001b[38;5;66;03m# Execute\u001b[39;00m\n\u001b[0;32m---> 71\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mnext_function\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnext_params\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 72\u001b[0m _logger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mresult\u001b[38;5;132;01m=}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 74\u001b[0m \u001b[38;5;66;03m# Update\u001b[39;00m\n",
"File \u001b[0;32m~/Developer/autora-workflow/src/autora/workflow/executor.py:174\u001b[0m, in \u001b[0;36mfull_cycle_wrapper.<locals>._executor_full_cycle\u001b[0;34m(state, params)\u001b[0m\n\u001b[1;32m 169\u001b[0m experimentalist_params \u001b[38;5;241m=\u001b[39m params\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexperimentalist\u001b[39m\u001b[38;5;124m\"\u001b[39m, {})\n\u001b[1;32m 171\u001b[0m experimentalist_executor \u001b[38;5;241m=\u001b[39m from_experimentalist_pipeline(\n\u001b[1;32m 172\u001b[0m experimentalist_pipeline\n\u001b[1;32m 173\u001b[0m )\n\u001b[0;32m--> 174\u001b[0m experimentalist_result \u001b[38;5;241m=\u001b[39m \u001b[43mexperimentalist_executor\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexperimentalist_params\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 176\u001b[0m experiment_runner_params \u001b[38;5;241m=\u001b[39m params\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexperiment_runner\u001b[39m\u001b[38;5;124m\"\u001b[39m, {})\n\u001b[1;32m 177\u001b[0m experiment_runner_executor \u001b[38;5;241m=\u001b[39m from_experiment_runner_callable(\n\u001b[1;32m 178\u001b[0m experiment_runner_callable\n\u001b[1;32m 179\u001b[0m )\n",
"File \u001b[0;32m~/Developer/autora-workflow/src/autora/workflow/executor.py:64\u001b[0m, in \u001b[0;36mfrom_experimentalist_pipeline.<locals>._executor_experimentalist\u001b[0;34m(state, params)\u001b[0m\n\u001b[1;32m 62\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_executor_experimentalist\u001b[39m(state: SupportsControllerState, params: Dict):\n\u001b[1;32m 63\u001b[0m params_ \u001b[38;5;241m=\u001b[39m resolve_state_params(params, state)\n\u001b[0;32m---> 64\u001b[0m new_conditions \u001b[38;5;241m=\u001b[39m \u001b[43mpipeline\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mparams_\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 66\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(new_conditions, pd\u001b[38;5;241m.\u001b[39mDataFrame):\n\u001b[1;32m 67\u001b[0m new_conditions_array \u001b[38;5;241m=\u001b[39m new_conditions\n",
"File \u001b[0;32m~/Developer/autora-workflow/.venv/lib/python3.8/site-packages/autora/experimentalist/pipeline.py:171\u001b[0m, in \u001b[0;36mPipeline.__call__\u001b[0;34m(self, ex, **params)\u001b[0m\n\u001b[1;32m 169\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(pipe, Pipe)\n\u001b[1;32m 170\u001b[0m all_params_for_pipe \u001b[38;5;241m=\u001b[39m merged_params\u001b[38;5;241m.\u001b[39mget(name, \u001b[38;5;28mdict\u001b[39m())\n\u001b[0;32m--> 171\u001b[0m results\u001b[38;5;241m.\u001b[39mappend(\u001b[43mpipe\u001b[49m\u001b[43m(\u001b[49m\u001b[43mresults\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mall_params_for_pipe\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[1;32m 173\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m results[\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m]\n",
"Cell \u001b[0;32mIn[3], line 9\u001b[0m, in \u001b[0;36mcustom_random_sampler\u001b[0;34m(conditions, n)\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcustom_random_sampler\u001b[39m(conditions, n):\n\u001b[0;32m----> 9\u001b[0m sampled_conditions \u001b[38;5;241m=\u001b[39m \u001b[43mrandom_sampler_rng\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mchoice\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconditions\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msize\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mreplace\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 10\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m sampled_conditions\n",
"File \u001b[0;32m_generator.pyx:729\u001b[0m, in \u001b[0;36mnumpy.random._generator.Generator.choice\u001b[0;34m()\u001b[0m\n",
"\u001b[0;31mValueError\u001b[0m: a cannot be empty unless no samples are taken"
]
}
],
"source": [
"cycle_with_state_dep_properties.run() # doctest: +ELLIPSIS"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pd.concat(cycle_with_state_dep_properties.data.conditions, ignore_index=True)\n"
"cycle_with_state_dep_properties.run()\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "docs/index.md"
license = { text = "MIT License" }

dependencies = [
"autora-core",
"autora-core>=3.2.0",
"scikit-learn",
"matplotlib",
"pandas",
Expand Down
Loading