Skip to content

Commit

Permalink
Allow some passing of kwargs to activities
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdailis committed Jul 6, 2024
1 parent 3ecb405 commit e8314e7
Show file tree
Hide file tree
Showing 52 changed files with 579 additions and 40 deletions.
Binary file modified .DS_Store
Binary file not shown.
12 changes: 11 additions & 1 deletion docs-src/2_guides/telecom.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ distance between them and any obstructions or media in the communication path.

The availability of a communication link depends on whether there is an occultation of some body between the transmitter
and receiver, whether the transmitter or receiver is able to be pointed towards the other, and whether the transmitter
or receiver has been allocated for a different purpose and is busy.
or receiver has been allocated for a different purpose and is busy.

```{math}
(a + b)^2 = a^2 + 2ab + b^2
(a - b)^2 = a^2 - 2ab + b^2
```

https://www.mathworks.com/discovery/link-budget.html

http://www.sss-mag.com/pdf/an9804.pdf
17 changes: 17 additions & 0 deletions docs-src/common-errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Common Errors

This section describes some errors you might encounter, and what to do about them

## ImportError - circular import

```
ImportError: cannot import name '...' from partially initialized module 'mission' (most likely due to a circular import)
```

This error means you have two python files that import each other. This can occur if you have an activity defined in
one file, and a model in another, and the two reference each other.

The recommended practice here is _not_ to import activities from the model file - activities should reference the model,
not the other way around. The activity files will need to be imported from your main file prior to running simulation.
Convenient as it may seem, we do _not_ recommend using your model file as your main file - make a separate `main.py` and
import both the model and the activities.
1 change: 1 addition & 0 deletions docs-src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ quickstart
2_guides/index
3_explanation/index
apidocs/index
common-errors
```

```{toctree}
Expand Down
1 change: 1 addition & 0 deletions docs/1_tutorials/1_gettingstarted.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/1_tutorials/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/1_tutorials/tutorial2.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/2_guides/datamodel.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
2 changes: 2 additions & 0 deletions docs/2_guides/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down Expand Up @@ -352,5 +353,6 @@ <h1>Guides<a class="headerlink" href="#guides" title="Link to this heading">¶</
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/scripts/furo.js?v=4e2eecee"></script>
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions docs/2_guides/jupyter.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/2_guides/powermodel.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/2_guides/scheduling.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/2_guides/spice.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
8 changes: 8 additions & 0 deletions docs/2_guides/telecom.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down Expand Up @@ -302,6 +303,12 @@ <h1>Modeling Telecom<a class="headerlink" href="#modeling-telecom" title="Link t
<p>The availability of a communication link depends on whether there is an occultation of some body between the transmitter
and receiver, whether the transmitter or receiver is able to be pointed towards the other, and whether the transmitter
or receiver has been allocated for a different purpose and is busy.</p>
<div class="math-wrapper docutils container">
<div class="math notranslate nohighlight">
\[ \begin{align}\begin{aligned} (a + b)^2 = a^2 + 2ab + b^2\\ (a - b)^2 = a^2 - 2ab + b^2\end{aligned}\end{align} \]</div>
</div>
<p>https://www.mathworks.com/discovery/link-budget.html</p>
<p>http://www.sss-mag.com/pdf/an9804.pdf</p>
</section>

</article>
Expand Down Expand Up @@ -357,5 +364,6 @@ <h1>Modeling Telecom<a class="headerlink" href="#modeling-telecom" title="Link t
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/scripts/furo.js?v=4e2eecee"></script>
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions docs/3_explanation/co-simulation.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/3_explanation/command-errors.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/3_explanation/fidelity.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/3_explanation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/3_explanation/planning.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/3_explanation/simulation.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
12 changes: 11 additions & 1 deletion docs/_sources/2_guides/telecom.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ distance between them and any obstructions or media in the communication path.

The availability of a communication link depends on whether there is an occultation of some body between the transmitter
and receiver, whether the transmitter or receiver is able to be pointed towards the other, and whether the transmitter
or receiver has been allocated for a different purpose and is busy.
or receiver has been allocated for a different purpose and is busy.

```{math}
(a + b)^2 = a^2 + 2ab + b^2

(a - b)^2 = a^2 - 2ab + b^2
```

https://www.mathworks.com/discovery/link-budget.html

http://www.sss-mag.com/pdf/an9804.pdf
17 changes: 17 additions & 0 deletions docs/_sources/common-errors.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Common Errors

This section describes some errors you might encounter, and what to do about them

## ImportError - circular import

```
ImportError: cannot import name '...' from partially initialized module 'mission' (most likely due to a circular import)
```

This error means you have two python files that import each other. This can occur if you have an activity defined in
one file, and a model in another, and the two reference each other.

The recommended practice here is _not_ to import activities from the model file - activities should reference the model,
not the other way around. The activity files will need to be imported from your main file prior to running simulation.
Convenient as it may seem, we do _not_ recommend using your model file as your main file - make a separate `main.py` and
import both the model and the activities.
1 change: 1 addition & 0 deletions docs/_sources/index.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ quickstart
2_guides/index
3_explanation/index
apidocs/index
common-errors
```

```{toctree}
Expand Down
1 change: 1 addition & 0 deletions docs/apidocs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/apidocs/pymerlin/pymerlin.duration.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions docs/apidocs/pymerlin/pymerlin.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down
7 changes: 4 additions & 3 deletions docs/apidocs/pymerlin/pymerlin.model_actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="index" title="Index" href="../../genindex.html" /><link rel="search" title="Search" href="../../search.html" /><link rel="next" title="Architecture" href="../../architecture.html" /><link rel="prev" title="pymerlin.duration" href="pymerlin.duration.html" />
<link rel="index" title="Index" href="../../genindex.html" /><link rel="search" title="Search" href="../../search.html" /><link rel="next" title="Common Errors" href="../../common-errors.html" /><link rel="prev" title="pymerlin.duration" href="pymerlin.duration.html" />

<!-- Generated with Sphinx 7.3.7 and Furo 2024.05.06 -->
<title>pymerlin.model_actions - pymerlin 0.0.5 documentation</title>
Expand Down Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
Expand Down Expand Up @@ -363,12 +364,12 @@ <h3>API<a class="headerlink" href="#api" title="Link to this heading">¶</a></h3
<footer>

<div class="related-pages">
<a class="next-page" href="../../architecture.html">
<a class="next-page" href="../../common-errors.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Architecture</div>
<div class="title">Common Errors</div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
Expand Down
7 changes: 4 additions & 3 deletions docs/architecture.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Developing pymerlin" href="developer.html" /><link rel="prev" title="pymerlin.model_actions" href="apidocs/pymerlin/pymerlin.model_actions.html" />
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Developing pymerlin" href="developer.html" /><link rel="prev" title="Common Errors" href="common-errors.html" />

<!-- Generated with Sphinx 7.3.7 and Furo 2024.05.06 -->
<title>Architecture - pymerlin 0.0.5 documentation</title>
Expand Down Expand Up @@ -243,6 +243,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="common-errors.html">Common Errors</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul class="current">
Expand Down Expand Up @@ -324,14 +325,14 @@ <h2>Approachability over performance<a class="headerlink" href="#approachability
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="apidocs/pymerlin/pymerlin.model_actions.html">
<a class="prev-page" href="common-errors.html">
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>Previous</span>
</div>

<div class="title"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pymerlin.model_actions</span></code></div>
<div class="title">Common Errors</div>

</div>
</a>
Expand Down
Loading

0 comments on commit e8314e7

Please sign in to comment.