From 41c8f4cb4d66e4eccdf5324775bde963951d5991 Mon Sep 17 00:00:00 2001 From: Benjamin Scholtz Date: Wed, 14 Aug 2024 13:01:03 +0100 Subject: [PATCH] Fix CI error (#145) * Update README.md * Update requirements to resolve dependency resolution issue * Update requirements to resolve dependency resolution issue * Remove support for Python 3.7, 3.8, add 3.10, 3.11 * Remove support for Python 3.7, 3.8, add 3.10, 3.11 * Remove support for Python 3.7, 3.8, add 3.10, 3.11 * Update typing_extensions version * Update pytest version to fix type error * Fix Jupyter Lab dependency errors * Update pylint version to fix error * Update Plotly version to fix error * Fix state variables default error --- .github/workflows/python.yml | 2 +- model/state_variables.py | 41 ++++++++++++++++++------------------ requirements.txt | 22 +++++++++---------- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 6e54891..b4bce80 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 diff --git a/model/state_variables.py b/model/state_variables.py index 5295fc6..91bd93d 100644 --- a/model/state_variables.py +++ b/model/state_variables.py @@ -26,6 +26,7 @@ Percentage, Stage, ) +from model.utils import default from data.historical_values import eth_price_mean, eth_price_min, eth_price_max @@ -137,46 +138,46 @@ class StateVariables: """The total realized MEV to validators post Proof-of-Stake""" # System metric state variables - validator_eth_staked: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=int + validator_eth_staked: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=int) ) """The ETH staked per validator environment""" - validator_revenue: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=int + validator_revenue: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=int) ) """The total revenue (income received) for performing PoS duties per validator environment""" - validator_profit: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=int + validator_profit: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=int) ) """The total profit (income received - costs) per validator environment""" - validator_revenue_yields: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=int + validator_revenue_yields: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=int) ) """The total annualized revenue (income received) yields (percentage of investment amount) per validator environment""" - validator_profit_yields: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=int + validator_profit_yields: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=int) ) """The total annualized profit (income received - costs) yields (percentage of investment amount) per validator environment""" - validator_count_distribution: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=int + validator_count_distribution: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=int) ) """The total number of validators per validator environment""" - validator_hardware_costs: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=USD + validator_hardware_costs: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=USD) ) """The total validator hardware operation costs per validator environment""" - validator_cloud_costs: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=USD + validator_cloud_costs: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=USD) ) """The total validator cloud operation costs per validator environment""" - validator_third_party_costs: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=USD + validator_third_party_costs: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=USD) ) """The total validator third-party fee costs validator environment""" - validator_costs: np.ndarray = np.zeros( - (number_of_validator_environments, 1), dtype=USD + validator_costs: np.ndarray = default( + np.zeros((number_of_validator_environments, 1), dtype=USD) ) """The total validator costs validator environment""" diff --git a/requirements.txt b/requirements.txt index d20f84f..2a2faa4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,19 +1,19 @@ radcad==0.8.4 -pytest==6.2.2 -ipykernel==5.5.3 -matplotlib==3.3.4 +pytest==8.3.2 +ipykernel==6.29.5 +matplotlib==3.5.0 plotly==4.14.3 stochastic==0.6.0 -typing_extensions==3.7.4.3 +typing_extensions==4.12.2 black==20.8b1 ipython-autotime==0.3.1 jupyter-dash==0.4.0 -jupyter-client==6.1.12 -jupyterlab==3.0.17 -ipywidgets==7.6.3 -notebook==6.4.12 +# jupyter-client +jupyterlab<4 +ipywidgets==8.1.3 +notebook<7 pdoc3==0.9.2 -jupyter-book==0.13.2 +jupyter-book==1.0.2 psutil==5.8.0 kaleido==0.2.1 jinja2==3.0.3 @@ -23,8 +23,8 @@ gunicorn==20.1.0 cadCAD_tools==0.0.1.4 tqdm==4.61.0 diskcache==5.2.1 -pylint==2.8.3 +pylint==3.2.6 python-dotenv==0.19.0 -jupyterlab-spellchecker==0.6.0 +jupyterlab-spellchecker<0.8 Werkzeug==2.0.3 click==8.0.4