Skip to content

Commit 41c767d

Browse files
committed
Small reformating changes
1 parent dda0efa commit 41c767d

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ This repository contains Python notebooks that demonstrate the Numerics .NET lib
3232
3. Build Numerics and confirm the DLL path matches what the notebooks expect.
3333
4. Open notebooks in Jupyter or VS Code and run cells top to bottom.
3434

35-
## Docs
36-
- `docs/api_cheatsheet.md` Quick mapping of common Numerics tasks to PythonNet calls.
37-
3835
## Notes
3936
- These notebooks compare Numerics to common Python libraries where relevant. When comparing MCMC chains, align warmup/thinning settings.
4037
- Many examples use synthetic data to keep results consistent and easy to interpret.

notebooks/00_getting_started.ipynb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
},
317317
{
318318
"cell_type": "code",
319-
"execution_count": 5,
319+
"execution_count": null,
320320
"id": "d51dfbec",
321321
"metadata": {
322322
"execution": {
@@ -332,7 +332,7 @@
332332
"output_type": "stream",
333333
"text": [
334334
"Python list: [10.5, 20.3, 15.7, 18.9, 22.1]\n",
335-
".NET array length: 5\n",
335+
".NET array: [10.5, 20.3, 15.7, 18.9, 22.1]\n",
336336
"Converted back: [10.5, 20.3, 15.7, 18.9, 22.1]\n"
337337
]
338338
}
@@ -343,7 +343,8 @@
343343
"dotnet_array = Array[Double](python_data)\n",
344344
"\n",
345345
"print(f\"Python list: {python_data}\")\n",
346-
"print(f\".NET array length: {dotnet_array.Length}\")\n",
346+
"# Accessing .NET array elements since Python doesn't know how to print a .NET array directly\n",
347+
"print(f\".NET array: {[dotnet_array[i] for i in range(dotnet_array.Length)]}\")\n",
347348
"\n",
348349
"# .NET array back to Python list\n",
349350
"back_to_python = [dotnet_array[i] for i in range(dotnet_array.Length)]\n",
@@ -460,6 +461,7 @@
460461
"\n",
461462
"### 1. Runtime Not Loaded Error\n",
462463
"Make sure you load the runtime BEFORE importing clr.\n",
464+
"\n",
463465
"```python\n",
464466
"# X WRONG - will fail\n",
465467
"import clr\n",
@@ -471,11 +473,13 @@
471473
"pythonnet.load(\"coreclr\")\n",
472474
"import clr\n",
473475
"```\n",
476+
"\n",
474477
"### 2. DLL Not Found\n",
475478
"Verify the path in `dll_path` is correct and points to a dll that exists. If no dll exists, be sure that you have built the Numerics solution.\n",
476479
"\n",
477480
"### 3. Loading DLL More Than Once\n",
478-
"When running multiple files at once, if they all load Numerics with ```clr.AddReference(str(dll_path))``` it may fail with an error that Numerics has already been loaded. If this happens, add the statement below to check the assemblies and only load Numerics if it is not already loaded.\n",
481+
"When running multiple files at once, if they all load Numerics with ```clr.AddReference(str(dll_path))``` it may fail with an error that Numerics has already been loaded. If this happens, add the statement below to check the assemblies and only load Numerics if it is not already loaded. The code below doesn't output anything, but you'll know it worked if it runs without the failure error of loading multiple DLLS. This error shouldn't happened within these notebooks because they all have seperate kernels. It would happen if you were trying to run multiple Python files all at once where each one loads the same DLL. In each of these files you would replace how you were orginally loading the DLL with the chunk below.\n",
482+
"\n",
479483
"```python\n",
480484
"# Needed to access the assemblies\n",
481485
"from System import AppDomain\n",
@@ -489,6 +493,7 @@
489493
"\n",
490494
"### 4. Array Type Mismatch\n",
491495
"Check that you're using .NET arrays where required.\n",
496+
"\n",
492497
"```python\n",
493498
"# X WRONG - Python list\n",
494499
"data = [1, 2, 3]\n",

0 commit comments

Comments
 (0)