Docs: Add anisotropic GMM example#162
Conversation
Adds an example of GMM fitting for anisotropic data to the AMReX documentation notebook. This new section includes: - Generation of synthetic anisotropic data. - Fitting a GMM to the data. - Extracting and verifying the physical parameters. - Visualization of the results.
Summary of ChangesHello @henry2004y, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the AMReX documentation by introducing a practical example of applying Gaussian Mixture Models (GMM) to anisotropic data. The addition guides users through the entire process, from generating synthetic anisotropic datasets to fitting GMMs, extracting specific physical parameters like parallel and perpendicular temperatures, and visualizing the results. This new content aims to provide a clearer understanding and practical application of GMMs for complex, directionally dependent data distributions. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
=======================================
Coverage 68.31% 68.31%
=======================================
Files 25 25
Lines 4191 4191
=======================================
Hits 2863 2863
Misses 1328 1328 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request adds a helpful example for anisotropic GMM fitting to the documentation notebook. The new section is well-structured with a clear explanation, code for data generation and fitting, and visualization of the results.
My review includes a critical fix for a KeyError that would prevent the example code from running, and a suggestion to remove a redundant import for better code hygiene. After addressing these points, the example will be a great addition to the documentation.
| " temp_par = round(params[\\\"temp_parallel\\\"], 5)\\n", | ||
| " temp_per = round(params[\\\"temp_perp\\\"], 5)\\n", | ||
| " print(f\\\"Component {i+1}: Center = {center}, Temp Parallel = {temp_par}, Temp Perp = {temp_per}\\\")" |
There was a problem hiding this comment.
The keys used to access the temperature parameters are incorrect. The get_gmm_parameters function returns dictionaries with keys "T_parallel" and "T_perpendicular" (note the capital 'T'). Using "temp_parallel" and "temp_perp" will cause a KeyError when the code is executed.
I've corrected the keys and also used more descriptive variable names for the extracted temperatures to improve clarity.
temp_par_ext = round(params[\"T_parallel\"], 5)
temp_per_ext = round(params[\"T_perpendicular\"], 5)
print(f\"Component {i+1}: Center = {center}, Temp Parallel = {temp_par_ext}, Temp Perp = {temp_per_ext}\")
| "from matplotlib.patches import Ellipse\\n", | ||
| "\\n", |
Adds an example of GMM fitting for anisotropic data to the AMReX documentation notebook. This new section includes: - Generation of synthetic anisotropic data. - Fitting a GMM to the data. - Extracting and verifying the physical parameters. - Visualization of the results.
Adds an example of GMM fitting for anisotropic data to the AMReX documentation notebook.
This new section includes: