Skip to content

Commit

Permalink
Document FileExistsError in Tslearn
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCatarino committed Jun 6, 2024
1 parent fab73e7 commit 4b34dd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ol>
<li>Set the key name of the model to be stored in the Object Store.</li>
<div class="section-example-container">
<pre class="python">model_key = "model"</pre>
<pre class="python">model_key = "model.hdf5"</pre>
</div>

<li>Call the <code class="csharp">GetFilePath</code><code class="python">get_file_path</code> method with the key.</li>
Expand All @@ -11,8 +11,10 @@
</div>
<p>This method returns the file path where the model will be stored.</p>

<li>Call the <code>to_hdf5</code> method with the file path.</li>
<li>Call the <code>to_hdf5</code> method with the file path. Delete the file to avoid <code>FileExistsError</code> from the <code>to_hdf5</code> method.</li>
<div class="section-example-container">
<pre class="python">self.model.to_hdf5(file_name + ".hdf5")</pre>
<pre class="python">import os
os.remove(file_name)
self.model.to_hdf5(file_name)</pre>
</div>
</ol>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="qc-embed-frame" style="display: inline-block; position: relative; width: 100%; min-height: 100px; min-width: 300px;">
<div class="qc-embed-dummy" style="padding-top: 56.25%;"></div>
<div class="qc-embed-element" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;">
<iframe class="qc-embed-backtest" height="100%" width="100%" style="border: 1px solid #ccc; padding: 0; margin: 0;" src="https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_e88254e5c91be4c906577ae735382795.html"></iframe>
<iframe class="qc-embed-backtest" height="100%" width="100%" style="border: 1px solid #ccc; padding: 0; margin: 0;" src="https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_473d150215a0f150f94205b157f34a93.html"></iframe>
</div>
</div>

0 comments on commit 4b34dd3

Please sign in to comment.