FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Notebooks for Watchdog demo and drive.pv() demo by N-3ielo · Pull Request #76 · ubermag/tutorials · GitHub

Notebooks for Watchdog demo and drive.pv() demo - #76

Draft
N-3ielo wants to merge 8 commits into
ubermag:masterfrom
N-3ielo:new_notebooks
Draft

N-3ielo wants to merge 8 commits into
ubermag:masterfrom
N-3ielo:new_notebooks

Conversation

N-3ielo commented Mar 26, 2025

Copy link
Copy Markdown

No description provided.

N-3ielo changed the title This notebook is a demo for live plots whilst TD sim is running Notebooks for Watchdog demo and drive.pv() demo Apr 7, 2025

lang-m left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
  • Aways use PyVista spelling with capital P and V
  • The four functions in the pyvista notebook are nearly identical. The only difference is in the implementation of the callback function. I would combine the functions. We can discuss different options how to do this.

"source": [
"## System Setup\n",
"\n",
"First we import our modules"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Add a brief comment what panel is needed for (maybe just refer to a more detailed explanation further down in the notebook).

"id": "b60581e3",
"metadata": {},
"source": [
"Below we initialise our system"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Say where the example is taken from/what physical system we simulate.

"id": "25e93571",
"metadata": {},
"source": [
"We run our `TimeDriver` simulation below for **5** ns and save our magnetisation in **50** steps"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
"We run our `TimeDriver` simulation below for **5** ns and save our magnetisation in **50** steps"
"We run our `TimeDriver` simulation below for 5 ns and save our magnetisation in 50 steps"

"outputs": [],
"source": [
"class DirectoryMonitorHandler(FileSystemEventHandler):\n",
" def __init__(self, observer, stop_flag):\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think you need to pass working_directory to ensure you are looking for filesystem events in the right place.

"\n",
" def process_file(self, file_path):\n",
" # Only process files with specific extensions\n",
" if file_path.endswith(r\".omf\"):\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
" if file_path.endswith(r\".omf\"):\n",
" if file_path.endswith(\".omf\"):\n",

No need for a raw string here.

" def process_file(self, file_path):\n",
" # Only process files with specific extensions\n",
" if file_path.endswith(r\".omf\"):\n",
" field = df.Field.from_file(rf\"{file_path}\")\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You also should not need a raw string here.

" angle = np.arctan2(yxa, xxa) # angle of vector line\n",
" mag = np.sqrt(xxa**2 + yxa**2) # magnitude of vector\n",
"\n",
" table = xr.Dataset(\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Rename object

" def check_observer(self):\n",
" if self.file_count >= self.n + 1:\n",
" print(\"All files produced, stopping monitoring...\")\n",
" self.observer.stop()\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You should not need to stop the observer here. It will be stopped in main

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL