Skip to content

Commit

Permalink
Deployed 4fbc7ba to latest with MkDocs 1.5.3 and mike 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TEAM4-0 committed Oct 23, 2023
1 parent 22c9954 commit 9e7d0c7
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 61 deletions.
4 changes: 4 additions & 0 deletions latest/CHANGELOG/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@

**Fixed bugs:**

- Wrong OPTIMADEStructureAttributes datamodel [\#164](https://github.com/SINTEF/oteapi-optimade/issues/164)
- OPTIMADE plugin produces empty instances of http://onto-ns.com/meta/1.0/OPTIMADEStructureSpecies [\#162](https://github.com/SINTEF/oteapi-optimade/issues/162)
- Pipeline figure not being shown in docs [\#144](https://github.com/SINTEF/oteapi-optimade/issues/144)
- Updated DLite installation pathway [\#136](https://github.com/SINTEF/oteapi-optimade/issues/136)
- `Segmentation fault` from dlite in CI [\#115](https://github.com/SINTEF/oteapi-optimade/issues/115)
- init file missing in the new `dlite` module [\#113](https://github.com/SINTEF/oteapi-optimade/issues/113)

**Closed issues:**

- Make the JSON-serialisation of entities human readable [\#160](https://github.com/SINTEF/oteapi-optimade/issues/160)
- Use ruff instead of pylint \(and isort\) [\#156](https://github.com/SINTEF/oteapi-optimade/issues/156)

**Merged pull requests:**

- Update data models [\#169](https://github.com/SINTEF/oteapi-optimade/pull/169) ([CasperWA](https://github.com/CasperWA))
- Move from pylint \(& isort\) to ruff [\#157](https://github.com/SINTEF/oteapi-optimade/pull/157) ([CasperWA](https://github.com/CasperWA))
- Use relative link, which works only in production [\#145](https://github.com/SINTEF/oteapi-optimade/pull/145) ([CasperWA](https://github.com/CasperWA))
- Avoid DLite v0.4.0 [\#139](https://github.com/SINTEF/oteapi-optimade/pull/139) ([CasperWA](https://github.com/CasperWA))
Expand Down
4 changes: 4 additions & 0 deletions latest/CHANGELOG/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1071,17 +1071,21 @@ <h2 id="unreleased-changes-2023-10-23"><a href="https://github.com/SINTEF/oteapi
</ul>
<p><strong>Fixed bugs:</strong></p>
<ul>
<li>Wrong OPTIMADEStructureAttributes datamodel <a href="https://github.com/SINTEF/oteapi-optimade/issues/164">#164</a></li>
<li>OPTIMADE plugin produces empty instances of http://onto-ns.com/meta/1.0/OPTIMADEStructureSpecies <a href="https://github.com/SINTEF/oteapi-optimade/issues/162">#162</a></li>
<li>Pipeline figure not being shown in docs <a href="https://github.com/SINTEF/oteapi-optimade/issues/144">#144</a></li>
<li>Updated DLite installation pathway <a href="https://github.com/SINTEF/oteapi-optimade/issues/136">#136</a></li>
<li><code>Segmentation fault</code> from dlite in CI <a href="https://github.com/SINTEF/oteapi-optimade/issues/115">#115</a></li>
<li>init file missing in the new <code>dlite</code> module <a href="https://github.com/SINTEF/oteapi-optimade/issues/113">#113</a></li>
</ul>
<p><strong>Closed issues:</strong></p>
<ul>
<li>Make the JSON-serialisation of entities human readable <a href="https://github.com/SINTEF/oteapi-optimade/issues/160">#160</a></li>
<li>Use ruff instead of pylint (and isort) <a href="https://github.com/SINTEF/oteapi-optimade/issues/156">#156</a></li>
</ul>
<p><strong>Merged pull requests:</strong></p>
<ul>
<li>Update data models <a href="https://github.com/SINTEF/oteapi-optimade/pull/169">#169</a> (<a href="https://github.com/CasperWA">CasperWA</a>)</li>
<li>Move from pylint (&amp; isort) to ruff <a href="https://github.com/SINTEF/oteapi-optimade/pull/157">#157</a> (<a href="https://github.com/CasperWA">CasperWA</a>)</li>
<li>Use relative link, which works only in production <a href="https://github.com/SINTEF/oteapi-optimade/pull/145">#145</a> (<a href="https://github.com/CasperWA">CasperWA</a>)</li>
<li>Avoid DLite v0.4.0 <a href="https://github.com/SINTEF/oteapi-optimade/pull/139">#139</a> (<a href="https://github.com/CasperWA">CasperWA</a>)</li>
Expand Down
36 changes: 22 additions & 14 deletions latest/api_reference/dlite/parse/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1142,22 +1142,22 @@ <h2 id="oteapi_optimade.dlite.parse.OPTIMADEDLiteParseStrategy" class="doc doc-h

<span class="n">entities_path</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span> <span class="o">/</span> <span class="s2">&quot;entities&quot;</span>

<span class="n">dlite</span><span class="o">.</span><span class="n">storage_path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">entities_path</span> <span class="o">/</span> <span class="s2">&quot;*.json&quot;</span><span class="p">))</span>
<span class="n">dlite</span><span class="o">.</span><span class="n">storage_path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">entities_path</span> <span class="o">/</span> <span class="s2">&quot;*.yaml&quot;</span><span class="p">))</span>

<span class="c1"># JSONAPIResourceLinks = dlite.Instance.from_url(</span>
<span class="c1"># f&quot;json://{entities_path}/JSONAPIResourceLinks.json&quot;</span>
<span class="c1"># f&quot;yaml://{entities_path}/JSONAPIResourceLinks.yaml&quot;</span>
<span class="c1"># )</span>
<span class="n">OPTIMADEStructure</span> <span class="o">=</span> <span class="n">dlite</span><span class="o">.</span><span class="n">Instance</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;json://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructure.json&quot;</span>
<span class="sa">f</span><span class="s2">&quot;yaml://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructure.yaml&quot;</span>
<span class="p">)</span>
<span class="n">OPTIMADEStructureAssembly</span> <span class="o">=</span> <span class="n">dlite</span><span class="o">.</span><span class="n">Instance</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;json://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureAssembly.json&quot;</span>
<span class="sa">f</span><span class="s2">&quot;yaml://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureAssembly.yaml&quot;</span>
<span class="p">)</span>
<span class="n">OPTIMADEStructureAttributes</span> <span class="o">=</span> <span class="n">dlite</span><span class="o">.</span><span class="n">Instance</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;json://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureAttributes.json&quot;</span>
<span class="sa">f</span><span class="s2">&quot;yaml://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureAttributes.yaml&quot;</span>
<span class="p">)</span>
<span class="n">OPTIMADEStructureSpecies</span> <span class="o">=</span> <span class="n">dlite</span><span class="o">.</span><span class="n">Instance</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;json://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureSpecies.json&quot;</span>
<span class="sa">f</span><span class="s2">&quot;yaml://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureSpecies.yaml&quot;</span>
<span class="p">)</span>

<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parse_config</span><span class="o">.</span><span class="n">configuration</span><span class="o">.</span><span class="n">return_object</span><span class="p">:</span>
Expand Down Expand Up @@ -1288,12 +1288,16 @@ <h2 id="oteapi_optimade.dlite.parse.OPTIMADEDLiteParseStrategy" class="doc doc-h

<span class="c1"># Attributes</span>
<span class="n">new_structure_attributes</span><span class="o">.</span><span class="n">update</span><span class="p">(</span>
<span class="n">structure</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">dict</span><span class="p">(</span><span class="n">exclude</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;species&quot;</span><span class="p">,</span> <span class="s2">&quot;assemblies&quot;</span><span class="p">})</span>
<span class="n">structure</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">dict</span><span class="p">(</span>
<span class="n">exclude</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;species&quot;</span><span class="p">,</span> <span class="s2">&quot;assemblies&quot;</span><span class="p">,</span> <span class="s2">&quot;nelements&quot;</span><span class="p">,</span> <span class="s2">&quot;nsites&quot;</span><span class="p">}</span>
<span class="p">)</span>
<span class="p">)</span>
<span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="nb">list</span><span class="p">(</span><span class="n">new_structure_attributes</span><span class="p">):</span>
<span class="k">if</span> <span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;_&quot;</span><span class="p">):</span>
<span class="n">new_structure_attributes</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>

<span class="c1"># Structure features values are Enum values, so we need to convert them to</span>
<span class="c1"># their string (true) values</span>
<span class="n">new_structure_attributes</span><span class="p">[</span><span class="s2">&quot;structure_features&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">_</span><span class="o">.</span><span class="n">value</span> <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="n">new_structure_attributes</span><span class="p">[</span><span class="s2">&quot;structure_features&quot;</span><span class="p">]</span>
<span class="p">]</span>
Expand Down Expand Up @@ -1439,22 +1443,22 @@ <h3 id="oteapi_optimade.dlite.parse.OPTIMADEDLiteParseStrategy.get" class="doc d

<span class="n">entities_path</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span> <span class="o">/</span> <span class="s2">&quot;entities&quot;</span>

<span class="n">dlite</span><span class="o">.</span><span class="n">storage_path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">entities_path</span> <span class="o">/</span> <span class="s2">&quot;*.json&quot;</span><span class="p">))</span>
<span class="n">dlite</span><span class="o">.</span><span class="n">storage_path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">entities_path</span> <span class="o">/</span> <span class="s2">&quot;*.yaml&quot;</span><span class="p">))</span>

<span class="c1"># JSONAPIResourceLinks = dlite.Instance.from_url(</span>
<span class="c1"># f&quot;json://{entities_path}/JSONAPIResourceLinks.json&quot;</span>
<span class="c1"># f&quot;yaml://{entities_path}/JSONAPIResourceLinks.yaml&quot;</span>
<span class="c1"># )</span>
<span class="n">OPTIMADEStructure</span> <span class="o">=</span> <span class="n">dlite</span><span class="o">.</span><span class="n">Instance</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;json://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructure.json&quot;</span>
<span class="sa">f</span><span class="s2">&quot;yaml://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructure.yaml&quot;</span>
<span class="p">)</span>
<span class="n">OPTIMADEStructureAssembly</span> <span class="o">=</span> <span class="n">dlite</span><span class="o">.</span><span class="n">Instance</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;json://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureAssembly.json&quot;</span>
<span class="sa">f</span><span class="s2">&quot;yaml://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureAssembly.yaml&quot;</span>
<span class="p">)</span>
<span class="n">OPTIMADEStructureAttributes</span> <span class="o">=</span> <span class="n">dlite</span><span class="o">.</span><span class="n">Instance</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;json://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureAttributes.json&quot;</span>
<span class="sa">f</span><span class="s2">&quot;yaml://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureAttributes.yaml&quot;</span>
<span class="p">)</span>
<span class="n">OPTIMADEStructureSpecies</span> <span class="o">=</span> <span class="n">dlite</span><span class="o">.</span><span class="n">Instance</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;json://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureSpecies.json&quot;</span>
<span class="sa">f</span><span class="s2">&quot;yaml://</span><span class="si">{</span><span class="n">entities_path</span><span class="si">}</span><span class="s2">/OPTIMADEStructureSpecies.yaml&quot;</span>
<span class="p">)</span>

<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parse_config</span><span class="o">.</span><span class="n">configuration</span><span class="o">.</span><span class="n">return_object</span><span class="p">:</span>
Expand Down Expand Up @@ -1585,12 +1589,16 @@ <h3 id="oteapi_optimade.dlite.parse.OPTIMADEDLiteParseStrategy.get" class="doc d

<span class="c1"># Attributes</span>
<span class="n">new_structure_attributes</span><span class="o">.</span><span class="n">update</span><span class="p">(</span>
<span class="n">structure</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">dict</span><span class="p">(</span><span class="n">exclude</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;species&quot;</span><span class="p">,</span> <span class="s2">&quot;assemblies&quot;</span><span class="p">})</span>
<span class="n">structure</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">dict</span><span class="p">(</span>
<span class="n">exclude</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;species&quot;</span><span class="p">,</span> <span class="s2">&quot;assemblies&quot;</span><span class="p">,</span> <span class="s2">&quot;nelements&quot;</span><span class="p">,</span> <span class="s2">&quot;nsites&quot;</span><span class="p">}</span>
<span class="p">)</span>
<span class="p">)</span>
<span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="nb">list</span><span class="p">(</span><span class="n">new_structure_attributes</span><span class="p">):</span>
<span class="k">if</span> <span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;_&quot;</span><span class="p">):</span>
<span class="n">new_structure_attributes</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>

<span class="c1"># Structure features values are Enum values, so we need to convert them to</span>
<span class="c1"># their string (true) values</span>
<span class="n">new_structure_attributes</span><span class="p">[</span><span class="s2">&quot;structure_features&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">_</span><span class="o">.</span><span class="n">value</span> <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="n">new_structure_attributes</span><span class="p">[</span><span class="s2">&quot;structure_features&quot;</span><span class="p">]</span>
<span class="p">]</span>
Expand Down
Loading

0 comments on commit 9e7d0c7

Please sign in to comment.