Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Apr 15, 2024
0 parents commit 08ff1c8
Show file tree
Hide file tree
Showing 67 changed files with 12,333 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 68acf2174999fab159275b7cda4cf075
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
306 changes: 306 additions & 0 deletions _modules/artipy/analysis/analyse.html

Large diffs are not rendered by default.

359 changes: 359 additions & 0 deletions _modules/artipy/analysis/plots.html

Large diffs are not rendered by default.

168 changes: 168 additions & 0 deletions _modules/artipy/analysis/simulate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>artipy.analysis.simulate &mdash; artipy 1.0.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=19f00094" />


<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="../../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../../_static/documentation_options.js?v=8d563738"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="../../../index.html" class="icon icon-home">
artipy
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../modules.html">src</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">artipy</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../../index.html">Module code</a></li>
<li class="breadcrumb-item active">artipy.analysis.simulate</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>Source code for artipy.analysis.simulate</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;This module contains functions to simulate artifacts.&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">random</span>

<span class="kn">from</span> <span class="nn">artipy.artifacts</span> <span class="kn">import</span> <span class="n">Artifact</span><span class="p">,</span> <span class="n">ArtifactBuilder</span>
<span class="kn">from</span> <span class="nn">artipy.artifacts.utils</span> <span class="kn">import</span> <span class="n">choose</span>
<span class="kn">from</span> <span class="nn">artipy.stats</span> <span class="kn">import</span> <span class="n">VALID_MAINSTATS</span>


<div class="viewcode-block" id="create_random_artifact">
<a class="viewcode-back" href="../../../artipy.analysis.html#artipy.analysis.simulate.create_random_artifact">[docs]</a>
<span class="k">def</span> <span class="nf">create_random_artifact</span><span class="p">(</span>
<span class="n">slot</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">random</span><span class="o">.</span><span class="n">choice</span><span class="p">((</span><span class="s2">&quot;flower&quot;</span><span class="p">,</span> <span class="s2">&quot;plume&quot;</span><span class="p">,</span> <span class="s2">&quot;sands&quot;</span><span class="p">,</span> <span class="s2">&quot;goblet&quot;</span><span class="p">,</span> <span class="s2">&quot;circlet&quot;</span><span class="p">)),</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Artifact</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Create a random artifact.</span>

<span class="sd"> :return: The random artifact.</span>
<span class="sd"> :rtype: Artifact</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">substat_count</span> <span class="o">=</span> <span class="mi">4</span> <span class="k">if</span> <span class="n">random</span><span class="o">.</span><span class="n">random</span><span class="p">()</span> <span class="o">&lt;</span> <span class="mf">0.2</span> <span class="k">else</span> <span class="mi">3</span>
<span class="n">mainstats</span><span class="p">,</span> <span class="n">mainstat_weights</span> <span class="o">=</span> <span class="nb">zip</span><span class="p">(</span><span class="o">*</span><span class="n">VALID_MAINSTATS</span><span class="p">[</span><span class="n">slot</span><span class="p">]</span><span class="o">.</span><span class="n">items</span><span class="p">())</span>
<span class="k">return</span> <span class="p">(</span>
<span class="n">ArtifactBuilder</span><span class="p">()</span>
<span class="o">.</span><span class="n">with_mainstat</span><span class="p">(</span><span class="n">choose</span><span class="p">(</span><span class="n">mainstats</span><span class="p">,</span> <span class="n">mainstat_weights</span><span class="p">))</span>
<span class="o">.</span><span class="n">with_rarity</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="o">.</span><span class="n">with_substats</span><span class="p">(</span><span class="n">amount</span><span class="o">=</span><span class="n">substat_count</span><span class="p">)</span>
<span class="o">.</span><span class="n">with_slot</span><span class="p">(</span><span class="n">slot</span><span class="p">)</span>
<span class="o">.</span><span class="n">build</span><span class="p">()</span>
<span class="p">)</span></div>



<div class="viewcode-block" id="upgrade_artifact_to_max">
<a class="viewcode-back" href="../../../artipy.analysis.html#artipy.analysis.simulate.upgrade_artifact_to_max">[docs]</a>
<span class="k">def</span> <span class="nf">upgrade_artifact_to_max</span><span class="p">(</span><span class="n">artifact</span><span class="p">:</span> <span class="n">Artifact</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Artifact</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Upgrade an artifact to its maximum level.</span>

<span class="sd"> :param artifact: The artifact to upgrade.</span>
<span class="sd"> :type artifact: Artifact</span>
<span class="sd"> :return: The upgraded artifact.</span>
<span class="sd"> :rtype: Artifact</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">while</span> <span class="n">artifact</span><span class="o">.</span><span class="n">get_level</span><span class="p">()</span> <span class="o">&lt;</span> <span class="n">artifact</span><span class="o">.</span><span class="n">get_rarity</span><span class="p">()</span> <span class="o">*</span> <span class="mi">4</span><span class="p">:</span>
<span class="n">artifact</span><span class="o">.</span><span class="n">upgrade</span><span class="p">()</span>
<span class="k">return</span> <span class="n">artifact</span></div>



<div class="viewcode-block" id="create_multiple_random_artifacts">
<a class="viewcode-back" href="../../../artipy.analysis.html#artipy.analysis.simulate.create_multiple_random_artifacts">[docs]</a>
<span class="k">def</span> <span class="nf">create_multiple_random_artifacts</span><span class="p">(</span><span class="n">amount</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">1</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">list</span><span class="p">[</span><span class="n">Artifact</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Create multiple random artifacts.</span>

<span class="sd"> :param amount: The amount of artifacts to create, defaults to 1</span>
<span class="sd"> :type amount: int, optional</span>
<span class="sd"> :return: The list of random artifacts.</span>
<span class="sd"> :rtype: list[Artifact]</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">result</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">amount</span><span class="p">):</span>
<span class="n">slot</span> <span class="o">=</span> <span class="n">random</span><span class="o">.</span><span class="n">choice</span><span class="p">((</span><span class="s2">&quot;flower&quot;</span><span class="p">,</span> <span class="s2">&quot;plume&quot;</span><span class="p">,</span> <span class="s2">&quot;sands&quot;</span><span class="p">,</span> <span class="s2">&quot;goblet&quot;</span><span class="p">,</span> <span class="s2">&quot;circlet&quot;</span><span class="p">))</span>
<span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">create_random_artifact</span><span class="p">(</span><span class="n">slot</span><span class="p">))</span>
<span class="k">return</span> <span class="n">result</span></div>

</pre></div>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2024, Truman Mulholland.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
Loading

0 comments on commit 08ff1c8

Please sign in to comment.