diff --git a/lectures/back_prop.md b/lectures/back_prop.md index 9780ef8c3..56a630948 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -32,9 +32,11 @@ In addition to what's included in base Anaconda, we need to install the followin ```{code-cell} ipython3 :tags: [hide-output] - -!pip install kaleido -!conda install -y -c plotly plotly plotly-orca retrying +import warnings +with warnings.catch_warnings(): + warnings.filterwarnings("ignore", message=".*os.fork.*") + !pip install kaleido + !conda install -y -c plotly plotly plotly-orca retrying ``` ```{note} diff --git a/lectures/status.md b/lectures/status.md index ca1d9dd2e..ab3981b09 100644 --- a/lectures/status.md +++ b/lectures/status.md @@ -23,14 +23,20 @@ These lectures are built on `linux` instances through `github actions`. These lectures are using the following python version ```{code-cell} ipython -!python --version +import warnings +with warnings.catch_warnings(): + warnings.filterwarnings("ignore", message=".*os.fork.*") + !python --version ``` and the following package versions ```{code-cell} ipython :tags: [hide-output] -!conda list +import warnings +with warnings.catch_warnings(): + warnings.filterwarnings("ignore", message=".*os.fork.*") + !conda list ``` You can check the backend used by JAX using: @@ -44,5 +50,8 @@ print(f"JAX backend: {jax.devices()[0].platform}") and this lecture series also has access to the following GPU ```{code-cell} ipython -!nvidia-smi +import warnings +with warnings.catch_warnings(): + warnings.filterwarnings("ignore", message=".*os.fork.*") + !nvidia-smi ``` \ No newline at end of file diff --git a/lectures/two_auctions.md b/lectures/two_auctions.md index 0f2ed02c8..0829548f8 100644 --- a/lectures/two_auctions.md +++ b/lectures/two_auctions.md @@ -403,6 +403,11 @@ def evaluate_largest(v_hat, array, order=1): array_conditional=array_residual[:,index].copy() array_conditional=np.sort(array_conditional, axis=0) + + # Handle empty array case to avoid "Mean of empty slice" warning + if array_conditional.shape[1] == 0: + return np.nan + return array_conditional[-order,:].mean() ``` @@ -561,6 +566,10 @@ class bid_price_solution: array_conditional=np.sort(array_conditional, axis=0) + # Handle empty array case to avoid "Mean of empty slice" warning + if array_conditional.shape[1] == 0: + return np.nan + return array_conditional[-order,:].mean() def compute_optimal_bid_FPSB(self):