docs(ridfire)

Added more documentation, also moved all engine code into
gridfire::engine namespace to be more in line with other parts of teh
code base
This commit is contained in:
2025-11-24 09:07:49 -05:00
parent 15ed7f70b1
commit 9fab4fbfae
64 changed files with 2506 additions and 848 deletions

View File

@@ -0,0 +1,3 @@
#pragma once
#include "gridfire/io/generative/python.h"

View File

@@ -6,16 +6,59 @@
#include "gridfire/reaction/reaction.h"
#include "gridfire/engine/engine_abstract.h"
/**
* @brief Namespace for generative input/output functionalities.
*
* This namespace contains functions and structures related to exporting
* reactions and engines to Python code. It provides tools to convert
* internal representations of reactions and engines into Python functions
* and scripts that can be used for further analysis or integration with
* Python-based workflows.
*/
namespace gridfire::io::gen {
/**
* @brief Structure representing a Python function definition.
*
* This structure holds the name, code, and module requirements for
* a Python function that represents a reaction.
*/
struct PyFunctionDef {
std::string func_name;
std::string func_code;
std::vector<std::string> module_req;
};
/**
* @brief Exports a reaction to a Python function definition.
*
* @param reaction The reaction to export.
* @return A PyFunctionDef structure containing the Python function
* representation of the reaction.
*
* This function converts the given reaction into a Python function
* definition, including the necessary code and module requirements.
*/
PyFunctionDef exportReactionToPy(const reaction::Reaction& reaction);
std::string exportEngineToPy(const DynamicEngine& engine);
/**
* @brief Exports a dynamic engine to a Python script.
*
* @param engine The dynamic engine to export.
* @return A string containing the Python script representation of the engine.
*
* This function converts the given dynamic engine into a Python script
* that can be used to recreate the engine's functionality in Python.
*/
std::string exportEngineToPy(const engine::DynamicEngine& engine);
void exportEngineToPy(const DynamicEngine& engine, const std::string& fileName);
/**
* @brief Exports a dynamic engine to a Python file.
*
* @param engine The dynamic engine to export.
* @param fileName The name of the file to write the Python script to.
*
* This function writes the Python script representation of the given
* dynamic engine to the specified file.
*/
void exportEngineToPy(const engine::DynamicEngine& engine, const std::string& fileName);
}

View File

@@ -1,3 +1,4 @@
#pragma once
#include "gridfire/io/network_file.h"
#include "gridfire/io/network_file.h"
#include "generative/generative.h"