Fix DLL Loading Dependency and Add Google Colab Integration#12
Fix DLL Loading Dependency and Add Google Colab Integration#12
Conversation
- Created centralized DLL loader in `pyadm1/utils/dll_loader.py` to resolve `optim_params` dependency issues by referencing all DLLs including `toolbox.dll`. - Updated `pyadm1/__init__.py` to automatically initialize DLLs on import. - Removed redundant `clr.AddReference` calls across the codebase. - Restored missing methods and properties in `feedstock.py` while maintaining pythonnet 3.x compatibility. - Added "Open in Colab" buttons to `README.md`, documentation homepages, and example pages (EN/DE). - Updated unit tests to align with centralized DLL loading. Co-authored-by: dgaida <23057824+dgaida@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Co-authored-by: dgaida <23057824+dgaida@users.noreply.github.com>
- Created centralized DLL loader in `pyadm1/utils/dll_loader.py` to resolve `optim_params` dependency issues by referencing all DLLs including `toolbox.dll`. - Updated `pyadm1/__init__.py` to automatically initialize DLLs on import. - Removed redundant `clr.AddReference` calls and unused imports across the codebase. - Restored missing methods and properties in `feedstock.py` while maintaining pythonnet 3.x compatibility. - Added "Open in Colab" buttons to `README.md`, documentation homepages, and example pages (EN/DE). - Fixed PEP 8 linting issues in `tests/unit/test_feedstock.py` and example notebooks. - Updated unit tests for `Feedstock` and `ADM1` to align with centralized DLL loading. Co-authored-by: dgaida <23057824+dgaida@users.noreply.github.com>
- Centralized DLL loading in `pyadm1/utils/dll_loader.py` to resolve `optim_params` assembly issues. - Updated `pyadm1/__init__.py` to initialize DLLs on import. - Cleaned up unused imports and localized DLL references. - Fixed logic errors in DLL method calls in `feedstock.py` and `adm1.py`. - Restored missing utility methods in `feedstock.py`. - Formatted all code with `black` to pass CI linting. - Updated unit tests to align with architectural changes. - Added "Open in Colab" buttons to documentation. Co-authored-by: dgaida <23057824+dgaida@users.noreply.github.com>
This PR addresses two main issues: a
FileNotFoundExceptionin Google Colab when loading DLLs and the need for better "Open in Colab" integration in the documentation.Changes:
pyadm1/utils/dll_loader.pyto handle allclr.AddReferencecalls.toolbox.dll, which resolves the missingoptim_paramsassembly dependency that was causing crashes in Colab environments.load_dlls()inpyadm1/__init__.pyto ensure resources are available upon package import.feedstock.py,digester.py,hydrolysis.py,adm1.py, andheating.py.feedstock.py(e.g.,get_substrate_feed_mixtures,calc_OLR_fromTOC) that were accidentally omitted or removed in a previous iteration, while keeping the improved pythonnet 3.x compatibility fixes.README.md.docs/en/index.md,docs/de/index.md) and individual example pages with Colab links for the basic and complex plant notebooks.DigesterandHeatingSystemto remove checks for localized DLL loading logic which is now centralized.Verification:
PR created automatically by Jules for task 17757892621211443985 started by @dgaida