From 6e562732e5de78a838e8febff33362c0a2f1163c Mon Sep 17 00:00:00 2001 From: morgan Date: Wed, 13 Dec 2023 15:51:46 +0800 Subject: [PATCH] turn .py files into wrpll_simulation package py files & notebook: update import docs: update install instructions --- README.md | 4 ++-- src/both_PLL_example.ipynb | 2 +- src/helper_PLL_example.ipynb | 3 ++- src/main_PLL_example.ipynb | 2 +- src/wrpll_simulation/__init__.py | 0 src/{ => wrpll_simulation}/sim.py | 2 +- src/{ => wrpll_simulation}/wave_gen.py | 0 src/{ => wrpll_simulation}/wrpll.py | 4 ++-- 8 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 src/wrpll_simulation/__init__.py rename src/{ => wrpll_simulation}/sim.py (99%) rename src/{ => wrpll_simulation}/wave_gen.py (100%) rename src/{ => wrpll_simulation}/wrpll.py (97%) diff --git a/README.md b/README.md index 9084449..352b874 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ A time domain simulation for WRPLL ### Poetry: ```bash -poetry install --no-root +poetry install poetry run jupyter lab ``` ### Poetry shell: ```bash -poetry install --no-root +poetry install poetry shell ``` diff --git a/src/both_PLL_example.ipynb b/src/both_PLL_example.ipynb index 0a77f7a..31835a5 100644 --- a/src/both_PLL_example.ipynb +++ b/src/both_PLL_example.ipynb @@ -39,7 +39,7 @@ "from plotly.subplots import make_subplots\n", "import plotly.graph_objects as go\n", "import numpy as np\n", - "from wrpll import WRPLL_simulator" + "from wrpll_simulation.wrpll import WRPLL_simulator" ] }, { diff --git a/src/helper_PLL_example.ipynb b/src/helper_PLL_example.ipynb index 78df824..e34ca68 100644 --- a/src/helper_PLL_example.ipynb +++ b/src/helper_PLL_example.ipynb @@ -39,7 +39,7 @@ "from plotly.subplots import make_subplots\n", "import plotly.graph_objects as go\n", "import numpy as np\n", - "from wrpll import WRPLL_simulator" + "from wrpll_simulation.wrpll import WRPLL_simulator" ] }, { @@ -103,6 +103,7 @@ "fig.add_trace(go.Scattergl(name='main'), hf_x=wrpll_sim.time, hf_y=wrpll_sim.main, row=2, col=1)\n", "fig.add_trace(go.Scattergl(name='helper'), hf_x=wrpll_sim.time, hf_y=wrpll_sim.helper-1, row=2, col=1)\n", "\n", + "\n", "fig.update_layout(\n", " xaxis2=dict(title=\"time (sec)\"),\n", "\n", diff --git a/src/main_PLL_example.ipynb b/src/main_PLL_example.ipynb index 0f78f15..3b74ece 100644 --- a/src/main_PLL_example.ipynb +++ b/src/main_PLL_example.ipynb @@ -42,7 +42,7 @@ "from plotly.subplots import make_subplots\n", "import plotly.graph_objects as go\n", "import numpy as np\n", - "from wrpll import WRPLL_simulator" + "from wrpll_simulation.wrpll import WRPLL_simulator" ] }, { diff --git a/src/wrpll_simulation/__init__.py b/src/wrpll_simulation/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/sim.py b/src/wrpll_simulation/sim.py similarity index 99% rename from src/sim.py rename to src/wrpll_simulation/sim.py index a20bc34..e81cdfc 100644 --- a/src/sim.py +++ b/src/wrpll_simulation/sim.py @@ -1,6 +1,6 @@ import numpy as np from numba import njit -from wave_gen import square +from wrpll_simulation.wave_gen import square @njit diff --git a/src/wave_gen.py b/src/wrpll_simulation/wave_gen.py similarity index 100% rename from src/wave_gen.py rename to src/wrpll_simulation/wave_gen.py diff --git a/src/wrpll.py b/src/wrpll_simulation/wrpll.py similarity index 97% rename from src/wrpll.py rename to src/wrpll_simulation/wrpll.py index c29805b..d2b5abd 100644 --- a/src/wrpll.py +++ b/src/wrpll_simulation/wrpll.py @@ -1,6 +1,6 @@ import numpy as np -from wave_gen import white_noise -from sim import simulation_jit +from wrpll_simulation.sim import simulation_jit +from wrpll_simulation.wave_gen import white_noise class WRPLL_simulator():