doc(tutorials): Add a tutorial on creating a DPF Python plugin for custom file formats#3065
doc(tutorials): Add a tutorial on creating a DPF Python plugin for custom file formats#3065
Conversation
…ansys/pydpf-core into feat/streams_container_creation
…hon_plugin_for_custom_file_format
|
Hey @oparreno, here is a proposal of a new tutorial which showcases what we discussed. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3065 +/- ##
==========================================
- Coverage 83.01% 82.94% -0.07%
==========================================
Files 93 93
Lines 11528 11528
==========================================
- Hits 9570 9562 -8
- Misses 1958 1966 +8 |
| return "myformat::myformat::time_freq_support_provider" | ||
|
|
||
|
|
||
| def _build_time_freq_support(model: reader.MyFormatModel) -> dpf.TimeFreqSupport: |
There was a problem hiding this comment.
@PProfizi, typically we create a MyFormatStream where we would use the reader to read and populate our DPF Objects. This stream will cache the data so that we don't have to read it every time. We would create this function there.
|
Some tests with 'continue-on-error: true' have failed:
Created by continue-on-error-comment |
|
@ricardopeixotocoelho, would you please also verify that this example uses the best practices we use for MAPDLOperators? |
This pull request introduces a comprehensive example DPF Python plugin for reading a custom file format ("MyFormat"). It includes all necessary components and sample data to demonstrate how to implement a fully functional DPF plugin, covering streams, mesh, results, and time-frequency support. Documentation is updated to reference this new tutorial.
MyFormat DPF Plugin Implementation:
Added the
my_format_pluginexample package, which includes:my_format_plugin.py) that registers all custom operators with DPF.cube_harmonic.myf) for demonstration and testing. [1] [2]Each operator is implemented with clear specifications, input/output pin definitions, and uses a shared file reader to parse the custom format. [1] [2]
Documentation Updates:
Sample Data:
.myfresult file (cube_harmonic.myf) containing mesh, frequency, and result data, used by the plugin and referenced in the documentation.These changes provide a complete, distributable reference for users to create their own DPF plugins for custom file formats.
dpf-site.zip.