+
+
+
diff --git a/pyproject.toml b/pyproject.toml
index b998759..7e21dc0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,7 +5,7 @@ build-backend = "maturin"
[project] # The rust bindings
name = "xiv_csolver_lib"
requires-python = ">=3.7"
-version = "0.1.5"
+version = "0.1.6"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
diff --git a/python/pyproject.toml b/python/pyproject.toml
index 7f9030e..f2d2440 100644
--- a/python/pyproject.toml
+++ b/python/pyproject.toml
@@ -9,7 +9,7 @@ authors = [
{name="Dandaedre"},
]
requires-python = ">=3.7"
-version = "0.1.5"
+version = "0.1.6"
license = {text="Mozilla Public License Version 2.0"}
classifiers = [
"Programming Language :: Rust",
diff --git a/python/src/xiv_csolver/resources/ffcraft_solver.ico b/python/src/xiv_csolver/resources/ffcraft_solver.ico
deleted file mode 100644
index 3b9f0cf..0000000
Binary files a/python/src/xiv_csolver/resources/ffcraft_solver.ico and /dev/null differ
diff --git a/python/src/xiv_csolver/resources/ffcraft_solver.png b/python/src/xiv_csolver/resources/ffcraft_solver.png
deleted file mode 100644
index 60a51ef..0000000
Binary files a/python/src/xiv_csolver/resources/ffcraft_solver.png and /dev/null differ
diff --git a/src/action.rs b/src/action.rs
index cf9d44e..89f16bb 100644
--- a/src/action.rs
+++ b/src/action.rs
@@ -1,24 +1,55 @@
+//! Module containing all actions that a crafter can execute
+//!
+//! All actions are defined as Action, containing all methods to actively use it in a craft
+//! while ActionBuilder is used only initally as a lazy_static setup
+//!
+
use crate::craft::Craft;
use crate::specs::{Buff, Success};
use lazy_static::lazy_static;
-#[allow(dead_code)]
use std::fmt::Debug;
+/// Hold an action for the solver to try using
+///
+/// It will be used heavily to try/discard actions durin craft
pub struct Action {
+ /// The action name, in a human readable format, it will be used to generate a short_name
pub name: String,
+ /// The natural durability cost, without buff or reductions
pub dur: u32,
+ /// The cost in cp
pub cp: u32,
+ /// The amount of progression provided in percent (not the actual value added to the craft)
pub progress: u32,
+ /// The amount of quality provided in percent (not the acual value added to the craft)
pub quality: u32,
+ /// The name of the buff given, if any
pub buff: Option<(Buff, u8)>,
+ /// The short name of the action, as used by most crafting simulator (aka: stripped of whitespace)
pub short_name: String,
}
+/// Builds an action based on an action
+///
+/// Made to initialize lazy_static and nothing more
pub struct ActionBuilder {
action: Action,
}
impl ActionBuilder {
+ /// Base creator, takes a name and initialize an empty action with the short_name
+ /// and name setup and default values for all other fields
+ ///
+ /// # Examples
+ /// ```
+ /// use xiv_csolver_lib::action::ActionBuilder;
+ /// use xiv_csolver_lib::specs::Buff;
+ /// ActionBuilder::new("Muscle Memory")
+ /// .cp(6)
+ /// .progress(300)
+ /// .buff(Some((Buff::MuscleMemory, 5)))
+ /// .build();
+ /// ```
pub fn new(name: &str) -> Self {
let mut short_name = name.to_string();
short_name = short_name.replace("II", "2");
@@ -46,31 +77,46 @@ impl ActionBuilder {
},
}
}
+ /// Changes the durability consumption of an action
pub fn dur(mut self, dur: u32) -> Self {
self.action.dur = dur;
self
}
+
+ /// Changes the crafting points (cp) consumption of an action
pub fn cp(mut self, cp: u32) -> Self {
self.action.cp = cp;
self
}
+ /// Changes the amount of progress of an action
pub fn progress(mut self, progress: u32) -> Self {
self.action.progress = progress;
self
}
+ /// Changes the amount of quality of an action
pub fn quality(mut self, quality: u32) -> Self {
self.action.quality = quality;
self
}
+ /// Makes an action add a buff for certain number of actions
+ /// The buffs available are defined in [specs.rs](crate::specs::Buff)
+ ///
+ /// ``
+ /// (self.recipe.progress as f32 - self.progression as f32) / self.get_base_progression() as f32;
+ /// ``
pub fn buff(mut self, buff: Option<(Buff, u8)>) -> Self {
self.action.buff = buff;
self
}
+ /// Finalize the usage of the ActionBuilder and return the action
+ /// Once again, all this is for the usage of lazy_static
pub fn build(self) -> Action {
self.action
}
}
+/// Custom implementation of the equality operator, it is used to compare actions during the
+/// the crafting process
impl PartialEq for Action {
fn eq(&self, other: &Self) -> bool {
self.cp == other.cp
@@ -80,10 +126,14 @@ impl PartialEq for Action {
}
}
+/// A craft action, after compilation (with lazy_static)
+// no other actions should be created
impl Action {
+ /// Get the printable name of the action
pub fn get_name(&self) -> String {
self.name.clone()
}
+ /// Get the CP cost, reduced by the eventual chain buffs currently active in the craft
pub fn get_cp_cost(&self, _craft: &Craft) -> u32 {
if self == &ACTIONS.standard_touch && _craft.buffs.basic_touch > 0 {
return 18;
@@ -93,6 +143,8 @@ impl Action {
};
self.cp
}
+ /// Get the durability cost this action would have if used at this stage of the craft
+ /// This method accounts for the effects of **master mend** and **waste not**.
pub fn get_durability_cost(&self, _craft: &Craft) -> u32 {
if self == &ACTIONS.masters_mend {
return 30;
@@ -109,6 +161,14 @@ impl Action {
}
dur
}
+ /// Get the progress effect this action would have if used at this stage of the craft
+ /// This method accounts for the effects of **groundwork** under 20 durability,
+ /// and the effects of **veneration** and **muscle memory**
+ /// # Exemple
+ /// ```md
+ /// - Groundwork will return 200 if the durability remaining is above 20
+ /// - Basic Synthesis will return 100 if no buffs are up and 150 with veneration
+ /// ```
pub fn get_progress(&self, _craft: &Craft) -> u32 {
let mut prog = self.progress as f64;
if self.dur == 20 && _craft.durability < self.get_durability_cost(_craft) as i32 {
@@ -123,6 +183,9 @@ impl Action {
}
(prog * mult).floor() as u32
}
+
+ /// Get the quality effect this action would have if used at this stage of the craft.
+ /// This method account for the **inner quiet** stacking effect, **innovation** and **great strides**
pub fn get_quality(&self, _craft: &Craft) -> u32 {
let mut qual = self.quality as f64;
if self == &ACTIONS.byregot_blessing {
@@ -141,9 +204,19 @@ impl Action {
let iq_mult = (_craft.buffs.inner_quiet as f64 * 0.1) + 1.0;
(qual * mult * iq_mult).floor() as u32
}
+ /// Returns the Buff (if any) up at this time of the craft
pub fn get_buff(&self) -> Option<(Buff, u8)> {
self.buff
}
+ /// Returns a bool representing if this action **can** be used, note that this does only account
+ /// for the game limitations and not viability limitation
+ ///
+ /// # Improvements
+ /// This function could easily prune useless actions by considering them not available.
+ /// Doing so could stop early refresh of buffs and spam of observe and such.
+ /// However some of such "optimisations" could just plain hurt the craft by forbidding a *seemingly*
+ /// useless action. The "bruteforce" method being easily computatble on a modern computer, such
+ /// optimisations arent warrented and left to aother time.
pub fn can_use(&self, _craft: &Craft) -> bool {
if self.get_cp_cost(_craft) > _craft.cp as u32 {
return false;
@@ -170,32 +243,110 @@ impl Debug for Action {
}
}
+/// The callable actionlist, to be used in conjunction with lazy_static
pub struct ActionList {
+ /// Increases progress.
+ /// Efficiency: 300%
+ /// Success Rate: 100%
+ /// Additional Effect: Efficiency of your next Synthesis action is increased by 100%
+ /// Available only on the first step.
+ /// Additional effect is active for five steps.
pub muscle_memory: Action,
+ /// Increases quality.
+ /// Efficiency: 100%
+ /// Success Rate: 100%
+ /// Additional Effect: Increases Inner Quiet stack by one (up to 10)
+ /// Availabe only on the first step.
pub reflect: Action,
+ /// Increases progress.
+ /// Efficiency: 120%
+ /// Success Rate: 100%
pub basic_synthesis: Action,
+ /// Increases progress.
+ /// Efficiency: 120%
+ /// Success Rate: 100%
pub careful_synthesis: Action,
+ /// Increases progress at greater cost to durability.
+ /// Efficiency decreases by half when durability is below durability cost.
+ /// Efficiency: 300%
+ /// Success Rate: 100%
+ /// Durability Cost: 20
pub groundwork: Action,
+ /// Increases progress at half the durability cost.
+ /// Efficiency: 180%
+ /// Success Rate: 100%
+ /// Unavailable when Waste Not or Waste Not II is active.
pub prudent_synthesis: Action,
+ /// Increases both progress and quality.
+ /// Efficiency: 100%
+ /// Success Rate: 100%
pub delicate_synthesis: Action,
+ /// Increases quality.
+ /// Efficiency: 100%
+ /// Success Rate: 100%
pub basic_touch: Action,
+ /// Increases quality.
+ /// Efficiency: 125%
+ /// Success Rate: 100%
+ /// Combo action: Basic Touch
+ /// Combo bonus: CP cost reduced to 18
pub standard_touch: Action,
+ /// Increases quality. Inner Quiet effect ends upon use.
+ /// Efficiency: 100% plus 20% for each count of your Inner Quiet stack, up to a maximum of 300%
+ /// Success Rate: 100%
+ /// Requires at least one stack of Inner Quiet.
pub byregot_blessing: Action,
+ /// Increases quality at half the durability cost.
+ /// Efficiency: 100%
+ /// Success Rate: 100%
+ /// Unavailable when Waste Not or Waste Not II are active.
pub prudent_touch: Action,
+ /// Increases quality at a greater cost to durability.
+ /// Additional Effect: Increases Inner Quiet stack by one (up to 11)
+ /// Efficiency: 200%
+ /// Success Rate: 100%
+ /// Durability Cost: 20
pub preparatory_touch: Action,
+ /// Increases quality.
+ /// Efficiency: 150%
+ /// Success Rate: 100%
+ /// Combo action: Standard Touch
+ /// Combo bonus: CP cost reduced to 18
pub advanced_touch: Action,
+ /// Increases quality at no cost to durability.
+ /// Efficiency: 100%
+ /// Success Rate: 100%
+ /// Available only when Inner Quiet stack size is 10.
pub trained_finesse: Action,
+ /// Restores item durability by 30.
pub masters_mend: Action,
+
+ // Restores item durability by 60.
+ // pub masters_mend_2: Action,
+ /// Reduces loss of durability by 50% for the next four steps.
pub waste_not: Action,
+ /// Reduces loss of durability by 50% for the next eight steps.
pub waste_not_ii: Action,
+ /// Restores 5 points of durability after each step for the next eight steps.
pub manipulation: Action,
+ /// Increases efficiency of Synthesis actions by 50% for the next four steps.
pub veneration: Action,
+ /// Increases the efficiency of next Touch action by 100%.
+ /// Effect active for three steps.
pub great_strides: Action,
+ /// Increases efficiency of Touch actions by 50% for the next four steps.
pub innovation: Action,
+ // Do nothing for one step.
//pub observe: Action,
+ // Increases progress.
+ // Efficiency: 200%
+ // Success Rate: 50%
+ // Combo Action: Observe
+ // Combo Bonus: Increases success rate to 100%
//pub focused_synthesis: Action,
}
+/// Create all base actions as a default (for lazy_static)
impl Default for ActionList {
fn default() -> Self {
Self {
@@ -300,5 +451,6 @@ impl Default for ActionList {
}
lazy_static! {
+ /// Initialize a static pseudo &Craft: ACTIONS
pub static ref ACTIONS: ActionList = ActionList::default();
}
diff --git a/src/bin/xiv_csolver.rs b/src/bin/xiv_csolver.rs
index de9c789..c94c690 100644
--- a/src/bin/xiv_csolver.rs
+++ b/src/bin/xiv_csolver.rs
@@ -1,4 +1,100 @@
-// #![warn(missing_docs,unsafe_code,unstable_features,)]
+//! # Solver bin for FFXIV Crafting in Rust
+//!
+//! This project strives to provide a fast, accurate and reliable way to craft
+//! in FFXIV and obtain HQ results
+//!
+//! This project also provides bindings for python to allow hooking it to any form of better GUI/CLI
+//!
+//! The project is (for now) self-hosted and hosted on [Github](https://github.com/Dandaedre/xiv_csolver)
+//!
+//! ## Getting started
+//!
+//! ### Development
+//!
+//! #### Rust
+//! To set up the whole development environment, it is recommended to use cargo-make
+//!
+//! Doing so will allow you custom commands to
+//!
+//! ```sh
+//! cargo make rebuild
+//! ```
+//! To rebuild the whole project
+//!
+//! ```sh
+//! cargo make release
+//! ```
+//! To generate the release files, bins and libs, package them and make them ready to release
+//!
+//! #### Python
+//!
+//! It is really recommended to set up a venv to handle the python development
+//!
+//! All bindings and the explanation of how to use them can be found in the [`io`](crate::io) module.
+//!
+//! ### Features
+//!
+//! Use these by running `cargo run/build --features `
+//!
+//! - ``no_python`` : Don't build the lib & python bindings (WIP, not fully implemented)
+//! - ``fast`` : Don't allow some under-optimisation to run (saving global run-time)
+//! - ``verbose`` : Allow for more debug messages (note that -v(vv) must still be passed to activate them)
+//!
+//! ## Regenerating the API Bindings
+//!
+//! The python bindings are generated using maturin
+//!
+//! ```sh
+//! cargo install maturin
+//! maturin develop
+//! ```
+//! ## Solving and bias
+//!
+//! The solving algorithm used has a very strong bias toward a particular method:
+//!
+//! - **Step 1** : Try to push the progression of the craft one step before being finishable
+//! - **Step 2** : Try to increase the quality as much as possible.
+//! - **Step 3** : Finish the craft
+//!
+//! To account for a lot of possibilities, step one generates all methods to try and finish the craft
+//! and step two tests all methods to up the quality until all crafting points are depleted
+//! Doing so ensures by brute force that all permutations are thoroughly tested.
+//!
+//! While this method works and is very likely the best method for the current patch,
+//! a rework of the crafting actions could very well make this method subpar or at least
+//! on par with another method.
+//!
+//! In layman's term, only the groundwork opening is tested and no delicate synthesis spam is tested.
+//! However, for now, these two crafting techniques remain subpar and discarding them comes at no
+//! loss for the crafter.
+//!
+//! Others algorithm exists and could very well cover all other basis at the expense of runtime.
+//! We have chosen not to implement them as they (for now) would be very unlikely to uncover anything
+//! meaningful.
+//!
+//! ### Leveling
+//!
+//! We have (for now at least) no intention to release a leveling feature to the crafting solver
+//! However, selecting some spells and buffs and have them disabled could be added as a feature
+//! hence making a "leveling" option
+//!
+//! If it is ever released, this feature is likely to be heavily reliant on the python GUI.
+//!
+//!
+//! ## Contributing
+//!
+//! All form of contributions are welcome !
+//!
+//! While this project was originally a collab and didn't strive to encompass every need
+//! of a modern FFXIV crafter, more polish and finish is always welcome.
+//!
+//! ## License
+//!
+//! The original code was released without a license by [RikaKagurasaka](https://github.com/RikaKagurasaka/xiv_craft_solver)
+//!
+//! All this fork's code is released under [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+#![warn(missing_docs)]
use clap::Parser;
use std::time::Instant;
diff --git a/src/craft.rs b/src/craft.rs
index 9a04e5a..b60e49f 100644
--- a/src/craft.rs
+++ b/src/craft.rs
@@ -1,24 +1,48 @@
+//! Module containing everything to create a craft and all methods to get the current state of the craft
+//!
+//! A craft represent the state of the recipe with a vector of actions applied to it.
+//! Applying actions to it will make the craft progress, while branching and trying other actions
+//! will be done by cloning
+//!
+
use crate::action::Action;
use crate::specs::{Buff, BuffState, Recipe, Stats, Success};
use crate::Parameters;
use std::fmt::{Debug, Display, Formatter};
+/// The craft structure, note that there is no standard way of backtracking
+/// and a traditional branching method is applied when solving.
#[derive(Clone)]
pub struct Craft<'a> {
+ /// The recipe used, contains all needed information on the difficulty and target
pub recipe: Recipe,
+ /// The stats of the crafter
pub stats: Stats,
+ /// The buffs currently running
pub buffs: BuffState,
+ /// The step count, aka number of steps done from the beggining of the craft
pub step_count: u32,
+ /// The remaining durability
pub durability: i32,
+ /// The current progression
pub progression: u32,
+ /// The current quality
pub quality: u32,
+ /// The cp currently remaining
pub cp: i32,
+ /// Wether the craft has succeded, is pending sucess, or failed
pub success: Success,
+ /// The vector of action already applied, structs are used for the vector since
+ /// static references are used and therefore take no additional memory at runtime
pub actions: Vec<&'a Action>,
+ /// The parameters used for the craft
+ /// TODO: The usage of a non reference is quite an oversight and should be changed ASAP
pub args: Parameters,
}
impl<'a> Craft<'a> {
+ /// Create a new craft with a recipe, stats and parameters
+ ///
pub fn new(recipe: Recipe, stats: Stats, params: Parameters) -> Craft<'a> {
Self {
recipe,
@@ -35,13 +59,18 @@ impl<'a> Craft<'a> {
}
}
+ /// How much progression will be done by an action with 100 efficiency and no buffs
+ /// This function is mainly used to know wether or not the craft will finish in
+ /// 1, 1.2 or 2.0 actions.
pub fn get_base_progression(&self) -> u32 {
let base_value = (self.stats.craftsmanship as f64 / 10.0)
/ (self.recipe.progress_divider as f64 / 100.0)
+ 2.0;
(base_value * (self.recipe.progress_modifier as f64 / 100.0) as f64).floor() as u32
}
-
+ /// How much quality will the crafter generate with one action with 100 efficiency and no buffs
+ /// This function is usually called by [`run_action`](crate::craft::Craft::run_action)
+ /// wich will then apply all needed buff and progress the craft
pub fn get_base_quality(&self) -> u32 {
let base_value = (self.stats.control as f64 / 10.0)
/ (self.recipe.quality_divider as f64 / 100.0)
@@ -49,6 +78,15 @@ impl<'a> Craft<'a> {
(base_value * (self.recipe.quality_modifier as f64 / 100.0) as f64).floor() as u32
}
+ /// Add an action to the current craft
+ /// This method will:
+ /// - Check wether the action can be used
+ /// - Increment the step count
+ /// - Decrease cp
+ /// - Decrease or increase durability
+ /// - Increase progression
+ /// - "Tick" buffs (substract 1 from their remaining time) and remove them if consumed
+ /// - Add the used action to the vec of actions used
pub fn run_action(&mut self, action: &'a Action) -> &mut Craft<'a> {
if !action.can_use(self) {
self.success = Success::Failure;
diff --git a/src/io.rs b/src/io.rs
index 83457d4..6c06e85 100644
--- a/src/io.rs
+++ b/src/io.rs
@@ -1,3 +1,9 @@
+//! The main IO module
+//! For now it contains the python bindings, the Args bindings (for clap) and the struct
+//! needed to hold all parameters needed at runtime
+//!
+//! Moving the bindings and making them non mandatory is a WIP
+
use crate::Craft;
use clap::Parser;
use core::fmt::Display;
@@ -5,15 +11,27 @@ use core::fmt::Display;
// #[cfg(not(feature = "no_python"))]
use pyo3::prelude::*;
+/// The parameters needed at runtime, used since Args cannot easily be passed to python
#[derive(Debug, Clone, Copy)]
pub struct Parameters {
+ /// The number of threads to use
+ /// TODO: Add an auto feature to guess threads depending on architecture and action pool
pub threads: usize,
+ /// The level of verbosity from 0 to 3
pub verbose: u8,
+ /// How many steps are allowed for finishing the craft
+ /// TODO: Be a little smarted about this approach and stop guessing if enough starters are found
+ /// and continue guessing if more are needed
pub depth: u32,
+ /// Wether to try every mesure to finish the craft or not
pub desperate: bool,
+ /// How early byregot will be used, setting it too low high miss easy solutions (for small crafts)
+ /// but setting it too low will have the solver try byregot way too often adding many useless crafts
+ /// in the pool of solutions
pub byregot_step: u8,
}
+/// The args passed to the CLI, used by clap to generate a nice argument parser
#[derive(Parser, Debug, Clone)]
#[command(author, version, about, long_about = None)]
pub struct Args {
@@ -52,47 +70,61 @@ pub struct Args {
/// A final stripped down version of a craft
/// used for final print and talking with python
+/// TODO: Half of these parameter are unique and SHOULD NOT be replicated on every solution
#[derive(Debug)]
#[pyclass]
pub struct SolverResult {
+ /// The number of steps this particular craft takes
#[pyo3(get)]
pub steps: u32,
+ /// The quality obtained at the end of the craft (absolute value)
#[pyo3(get)]
pub quality: u32,
+ /// The amount of progression obtained at the end of the craft (absolute value)
#[pyo3(get)]
pub progression: u32,
+ /// The remaining durability at the end of this craft
#[pyo3(get)]
pub durability: i32,
+ /// The remaining crafting points at the end of this craft
#[pyo3(get)]
pub cp: i32,
+ /// The total amount of crafting points the crafter had available (Deprecated)
#[pyo3(get)]
pub total_cp: u32,
+ /// The total amount of progression needed to finish the craft (Deprecated)
#[pyo3(get)]
pub total_progression: u32,
+ /// The total quality needed to make this craft 100% HQ (Deprecated)
#[pyo3(get)]
pub total_quality: u32,
+ /// The total durability for this craft (Deprecated)
#[pyo3(get)]
pub total_durability: u32,
+ /// The list of actions, as a string
#[pyo3(get)]
pub actions: Vec,
+ /// The amount of solutions found during the first step of the solving (Used for debug) (Deprecated)
#[pyo3(get)]
pub step1_solutions: usize,
+ /// The amount of solutions found at the end of the second step of solving (Used for debug) (Deprecated)
#[pyo3(get)]
pub step2_solutions: usize,
#[pyo3(get)]
+ /// Wether a 100% HQ solution was found (Deprecated)
pub found_100_percent: bool,
}
/// Pretty display for SolverResult
impl Display for SolverResult {
- fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
- println!("{:?}", self.actions);
- Ok(())
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+ write!(f, "{:?}", self.actions)
}
}
-//#[pymethods]
impl SolverResult {
+ /// Create a SolverResult from a solution
+ /// Using this returns a solution, usable by Python
pub fn from_craft(
craft: &Craft,
step1_solutions: usize,
@@ -104,6 +136,7 @@ impl SolverResult {
.iter()
.map(|action| format!("{}", action.short_name))
.collect::>();
+ // Todo: Stop adding these by hand
let arg = (craft.recipe.progress as f32 - craft.progression as f32)
/ craft.get_base_progression() as f32;
if 0.0 < arg && arg < 1.2 {
@@ -136,6 +169,12 @@ impl SolverResult {
#[pymethods]
impl SolverResult {
+ /// Default method to create an empty solution, only used for debug purposes
+ /// to test wether the import worked
+ /// ```py
+ /// import xiv_csolver_lib
+ /// print(xiv_csolver_lib.default())
+ /// ```
#[staticmethod]
pub fn default() -> Self {
Self {
@@ -155,6 +194,8 @@ impl SolverResult {
}
}
+ /// Implement a pretty_print method
+ /// Mainly used for debug purposes
pub fn pretty_print(&self) {
println!(
"Quality: [{}/{}] | Durability: [{}/{}] | Cp : [{}/{}] | Steps : {}",
@@ -171,6 +212,7 @@ impl SolverResult {
}
impl Parameters {
+ /// Create parameters from the arguments parsed by clap
pub fn from_args(args: &Args) -> Self {
Self {
depth: if args.desperate { 11 } else { 8 },
@@ -204,10 +246,37 @@ pub fn test_result() -> SolverResult {
#[cfg(not(feature = "no_python"))]
use crate::{solve_craft, Recipe, Stats};
+/// Solve a craft from parameters given by python
+/// The values are all obtained by a `&PyAny`, wich must guaranty that several attributes are
+/// accesible by `__getattr__`
+///
+/// ```python
+/// import xiv_craft_solver, rich
+///
+/// class FeedingClass:
+/// durability = 70
+/// progress = 3900
+/// quality = 10920
+/// progress_divider = 130
+/// quality_divider = 115
+/// progress_modifier = 80
+/// quality_modifier = 70
+/// craftsmanship = 4041
+/// control = 3959
+/// max_cp = 602
+/// # Config
+/// depth = 10
+/// byregot_step = 10
+/// desperate = False
+/// threads = 8
+/// verbose = 0
+/// crafting_feeder = FeedingClass()
+/// rich.inspect(xiv_csolver_lib.solve_from_python(crafting_feeder))
+/// ```
#[cfg(not(feature = "no_python"))]
#[pyfunction]
pub fn solve_from_python(values: &PyAny) -> PyResult