Skip to content

Commit

Permalink
Fix divide by zero issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulthran committed Jun 4, 2024
1 parent 94f8a43 commit bde59bc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ When running, it will default to using a SQLite3 database located in the root of
## Using the library

The `sample_registry` library can be installed and run anywhere by following the instructions in Development (you don't need to do the `create_test_db` and running the site (bottom two commands)). To connect it to a Postgres backend, you'll need to also set the environment variables `DB_HOST`, `DB_USER`, `DB_NAME`, and `DB_PSWD`.

## Manually build Docker image

If you want to iterate over a feature you can only test on the K8s deployment, you can manually build the Docker image instead of relying on the release workflow. Use `docker build -t ctbushman/sample_registry:latest -f Dockerfile .` to build the image and then `docker push ctbushman/sample_registry:latest` to push it to DockerHub. You can then trigger the K8s deployment to grab the new image.

N.B. You might want to use a different tag than `latest` if you're testing something volatile so that if someone else is trying to use the image as you're developing, they won't pull your wonky changes.
10 changes: 7 additions & 3 deletions app/templates/browse_tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ <h3>Standard annotations</h3>
<h3>Other sample annotations</h3>

<p class="tagcloud">
{% for tag in tags %}
<a href="{{ url_for('show_tags', tag=tag[0]) }}" style="font-size: {{ 10 + 90 * (tag[1] / maxcnt) }}px">{{ tag[0] }}</a>
{% endfor %}
{% if tags|length == 0 %}
<p>No tags found.</p>
{% else %}
{% for tag in tags %}
<a href="{{ url_for('show_tags', tag=tag[0]) }}" style="font-size: {{ 10 + 90 * (tag[1] / maxcnt) }}px">{{ tag[0] }}</a>
{% endfor %}
{% endif %}
</p>
{% endblock %}
8 changes: 8 additions & 0 deletions app/templates/show_stats.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{% extends 'base.html' %}

{% block body %}
{% if num_samples != 0 %}
<p>Every sample should have a SampleType: {{ num_samples_with_sampletype }} of {{ num_samples }} ({{ "%.2f"|format(100 * num_samples_with_sampletype / num_samples) }}%).</p>
{% endif %}

{% if num_samples_with_sampletype != 0 %}
<p>All SampleType values should be in the approved list: {{ num_samples_with_standard_sampletype }} of {{ num_samples_with_sampletype }} ({{ "%.2f"|format(100 * num_samples_with_standard_sampletype / num_samples_with_sampletype) }}%).</p>
{% endif %}

Standard sample types:
<table>
Expand All @@ -21,9 +25,13 @@
{% endfor %}
</table>

{% if num_subjectid != 0 %}
<p>If SubjectID tag is filled in, HostSpecies tag should also be filled in: {{ num_subjectid_with_hostspecies }} of {{ num_subjectid }} ({{ "%.2f"|format(100 * num_subjectid_with_hostspecies / num_subjectid) }}%).</p>
{% endif %}

{% if num_samples_with_hostspecies != 0 %}
<p>All HostSpecies values should be in the approved list: {{ num_samples_with_standard_hostspecies }} of {{ num_samples_with_hostspecies }} ({{ "%.2f"|format(100 * num_samples_with_standard_hostspecies / num_samples_with_hostspecies) }}%).</p>
{% endif %}

Standard host species:
<table>
Expand Down

0 comments on commit bde59bc

Please sign in to comment.