Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create plugin documentation #565

Merged

Conversation

alarshi
Copy link
Contributor

@alarshi alarshi commented Feb 14, 2024

This PR adds documentation on how to write a new plugin in GWB. It also fixes small typos that I came across while working on the write up.

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b72ce04) 93.49% compared to head (cd90f6b) 93.55%.
Report is 79 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #565      +/-   ##
==========================================
+ Coverage   93.49%   93.55%   +0.06%     
==========================================
  Files          92       92              
  Lines        6346     6346              
==========================================
+ Hits         5933     5937       +4     
+ Misses        413      409       -4     

see 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b72ce04...cd90f6b. Read the comment docs.

Copy link
Contributor

@gassmoeller gassmoeller left a comment

Choose a reason for hiding this comment

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

Very nice, just two small comments.

Copy link
Member

@MFraters MFraters left a comment

Choose a reason for hiding this comment

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

Great, thanks for writing this up!

I think it might also be useful to add here that you will need to change the Class names in both the header and source files, and change the headerguard in the header file. Furthermore, I think it would be useful to add what information you need to put in the register function (e.g. ClassName, name used in the input file). Could you add something like this?

@alarshi
Copy link
Contributor Author

alarshi commented Feb 14, 2024

Thank you for the review! I addressed your comments in the recent push. Let me know if we need more details.

Copy link

github-actions bot commented Feb 14, 2024

Benchmark Main Feature Difference (99.9% CI)
Slab interpolation simple none 1.025 ± 0.003 (s=436) 1.025 ± 0.003 (s=444) -0.0% .. +0.1%
Slab interpolation curved simple none 1.029 ± 0.004 (s=438) 1.029 ± 0.003 (s=439) -0.1% .. +0.1%
Spherical slab interpolation simple none 1.262 ± 0.005 (s=338) 1.262 ± 0.003 (s=378) -0.1% .. +0.0%
Slab interpolation simple curved CMS 1.099 ± 0.005 (s=458) 1.099 ± 0.006 (s=363) -0.1% .. +0.1%
Spherical slab interpolation simple CMS 1.865 ± 0.004 (s=245) 1.862 ± 0.005 (s=241) -0.2% .. -0.1%
Spherical fault interpolation simple none 1.275 ± 0.010 (s=334) 1.275 ± 0.004 (s=374) -0.2% .. +0.1%
Cartesian min max surface 2.383 ± 0.022 (s=183) 2.381 ± 0.022 (s=197) -0.4% .. +0.2%
Spherical min max surface 7.348 ± 0.018 (s=62) 7.351 ± 0.023 (s=63) -0.1% .. +0.2%

As an example, assume that you want to implement faults in your world that have compositional value that varies according to a hat function. In this case, the closest existing functionality is the `smooth` fault composition that varies following a hyperbolic tangent function. You can then rename the class to say Hat and modify the implementation of the relevant function, i.e., `get_composition()`, such that it now returns a compositional value based on the hat function.

#### Write a plugin from scratch
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, thank you !

@gassmoeller gassmoeller merged commit 05e3b9c into GeodynamicWorldBuilder:main Feb 14, 2024
34 checks passed
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.

3 participants