Skip to content

Commit

Permalink
Some deprectation fixes to the notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Wouda committed Oct 21, 2024
1 parent 9fdc8c9 commit 482c019
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions examples/permutation_flow_shop_problem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"import numpy as np\n",
"import numpy.random as rnd\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.cm as cm\n",
"\n",
"from alns import ALNS\n",
"from alns.accept import SimulatedAnnealing\n",
Expand Down Expand Up @@ -153,7 +152,7 @@
" start = completion - DATA.processing_times\n",
"\n",
" # Plot each job using its start and completion time\n",
" cmap = cm.get_cmap(\"rainbow\", n_jobs)\n",
" cmap = plt.get_cmap(\"rainbow\", n_jobs)\n",
" machines, length, start_job, job_colors = zip(\n",
" *[\n",
" (i, DATA.processing_times[i, j], start[i, j], cmap(j - 1))\n",
Expand Down
10 changes: 5 additions & 5 deletions examples/resource_constrained_project_scheduling_problem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
},
"outputs": [],
"source": [
"instance = ProblemData.read_instance(\"data/j9041_6.sm\")"
"instance = ProblemData.read_instance(\"examples/data/j9041_6.sm\")"
]
},
{
Expand Down Expand Up @@ -325,9 +325,9 @@
" def indices(self) -> np.ndarray:\n",
" \"\"\"\n",
" Returns a mapping from job -> idx in the schedule. Unscheduled\n",
" jobs have index +inf.\n",
" jobs have index num_jobs.\n",
" \"\"\"\n",
" indices = np.full(instance.num_jobs, np.inf, dtype=int)\n",
" indices = np.full(instance.num_jobs, instance.num_jobs, dtype=int)\n",
"\n",
" for idx, job in enumerate(self.jobs):\n",
" indices[job] = idx\n",
Expand Down Expand Up @@ -766,7 +766,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -780,7 +780,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 482c019

Please sign in to comment.