Skip to content

Commit

Permalink
Merge pull request #245 from UC-Davis-molecular-computing/233-for-spe…
Browse files Browse the repository at this point in the history
…ed-minimize-time-spent-creating-pintquantity-objects

233 for speed minimize time spent creating `pint.Quantity` objects
  • Loading branch information
dave-doty authored Oct 8, 2023
2 parents 563a4a7 + c76e7f0 commit 2ffe6ad
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 123 deletions.
17 changes: 6 additions & 11 deletions examples/many_strands_no_common_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
import nuad.constraints as nc # type: ignore
import nuad.vienna_nupack as nv # type: ignore
import nuad.search as ns # type: ignore
from nuad.constraints import NumpyFilter


def f(x: int | float) -> float:
return x / 2


# command-line arguments
Expand Down Expand Up @@ -51,13 +46,13 @@ def main() -> None:
random_seed = 1

# many 4-domain strands with no common domains, 4 domains each, every domain length = 10
# just for testing parallel processing

# num_strands = 3
# num_strands = 5
# num_strands = 10
# num_strands = 10
num_strands = 26
# num_strands = 50
# num_strands = 100
num_strands = 100
# num_strands = 355

design = nc.Design()
Expand All @@ -77,7 +72,7 @@ def main() -> None:
parallel = False
# parallel = True

numpy_filters: List[NumpyFilter] = [
numpy_filters: List[nc.NumpyFilter] = [
nc.NearestNeighborEnergyFilter(-9.3, -9.0, 52.0),
# nc.BaseCountFilter(base='G', high_count=1),
# nc.BaseEndFilter(bases=('C', 'G')),
Expand Down Expand Up @@ -157,11 +152,11 @@ def main() -> None:
params = ns.SearchParameters(constraints=[
# domain_nupack_ss_constraint,
# strand_individual_ss_constraint,
# strand_pairs_rna_duplex_constraint,
strand_pairs_rna_duplex_constraint,
# strand_pairs_rna_plex_constraint,
# strand_pair_nupack_constraint,
# domain_pair_nupack_constraint,
domain_pairs_rna_plex_constraint,
# domain_pairs_rna_plex_constraint,
# domain_pairs_rna_duplex_constraint,
# strand_base_pair_prob_constraint,
# nc.domains_not_substrings_of_each_other_constraint(),
Expand Down
69 changes: 69 additions & 0 deletions notebooks/result-allocate-time-trials.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,75 @@
"%timeit collect_results_into_noparse_nonormalize(energies, threshold, results)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "fa645805-54fd-4e64-9940-ae0a4da5ebc8",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEWCAYAAACKSkfIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAfWklEQVR4nO3de5wcZZ3v8c+XhJsg9xFDbgMY2AWEgBHwKAqCmCAL4rIQkLsSEFHx6Ip4zerhrCCsRw9uMEAWWOUqIjmccAkosKIBAkYSkGi4JkMuQ7gpCAj89o/nGSkmPTM9M53uJM/3/Xr1a7qfeqrqqerqb1c9VV2jiMDMzMqwVqsbYGZmzePQNzMriEPfzKwgDn0zs4I49M3MCuLQNzMriEN/gCQdJ+lXK2naf5a0zcqYdqM0cvkl3Sbpk42Ylq06JE2W9ONVfZo9zKddUkgaurLn1WxrROg3a0NolojYMCIeqbd+Ds2X8pfFU5J+JmlYZfjkvAEfVikbmsvau02rq+4eDVkYW6VJWkfSTyU9lt/3vfuov5mkayW9IOlxSUc2p6W9tukISZe1uh1d6tkhknSxpFfyZ7brMSQP21PSTElPS+qUdHX185zr7C5phqRnc727JR1fT/vWiNDvi5I1Ylm7NowaTo2IDYF3ABsC53Qb/jTwL72MjyQBx+S6xzSguWu8Ru8J5lBdu5HTrMOvgKOAJXXU/SHwCrAl8HFgiqQdV2Lb6vERYEaL2zAQZ+cdvK7Ha7l8U2Aq0A6MBv4E/EfXSJLeA/wCuJ30ed8c+BQwoZ6ZrlZBKOl0SR2S/iRpvqR9JY0HvgIcnr8tf5fr3ibpTEl3Ai8C20g6XtLv8/iPSDqpMu29JS2S9AVJyyQtrn5zStpc0nRJz0u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/CGXXwK8v1ELZlYPh76V5jnSf6J6X08V8h75vwOH5j3yC4D1alTdH7i58rrrn768Dvy1cgTwOr7Pla0iHPpWmleAQ4BjJB1J+pd8J+Wb2yFpM94I+KckbQgc2n0ikjYGhkbE8n7Mez7QLukd+fXRwO0DWwyzgXHoW3Ei4gVSH/3nSbexfgK4X9LvgCMj4lnS3v080p0O76kxmQ8Bt/Rzvi8BxwNX526j14HzB7gYZgPiu2yaDYCkC4ELI2JWq9ti1h8OfTOzgrh7x8ysIA59M7OCOPTNzAri0DczK4hD38ysIA59M7OC/DdtlfreOgBNAgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# test search.display_report after removing pint\n",
"\n",
"import nuad.constraints as nc\n",
"import nuad.search as ns\n",
"\n",
"random_seed = 1\n",
"\n",
"# many 4-domain strands with no common domains, 4 domains each, every domain length = 10\n",
"\n",
"# num_strands = 3\n",
"# num_strands = 5\n",
"# num_strands = 10\n",
"# num_strands = 50\n",
"num_strands = 100\n",
"\n",
"design = nc.Design()\n",
"# si wi ni ei\n",
"# strand i is [----------|----------|----------|---------->\n",
"for i in range(num_strands):\n",
" design.add_strand([f's{i}', f'w{i}', f'n{i}', f'e{i}'])\n",
"\n",
"numpy_filters = [nc.NearestNeighborEnergyFilter(-9.3, -9.0, 52.0)]\n",
"\n",
"replace_with_close_sequences = True\n",
"domain_pool_10 = nc.DomainPool(f'length-10_domains', 10,\n",
" numpy_filters=numpy_filters,\n",
" replace_with_close_sequences=replace_with_close_sequences,\n",
" )\n",
"domain_pool_11 = nc.DomainPool(f'length-11_domains', 11,\n",
" numpy_filters=numpy_filters,\n",
" replace_with_close_sequences=replace_with_close_sequences,\n",
" )\n",
"\n",
"for strand in design.strands:\n",
" for domain in strand.domains[:2]:\n",
" domain.pool = domain_pool_10\n",
" for domain in strand.domains[2:]:\n",
" domain.pool = domain_pool_11\n",
"\n",
"strand_pairs_rna_duplex_constraint = nc.rna_duplex_strand_pairs_constraint(\n",
" threshold=-1.0, temperature=52, short_description='RNAduplex')\n",
"\n",
"constraints = [strand_pairs_rna_duplex_constraint]\n",
"\n",
"ns.assign_sequences_to_domains_randomly_from_pools(design=design, warn_fixed_sequences=True)\n",
"\n",
"ns.display_report(design=design, constraints=constraints)"
]
},
{
"cell_type": "code",
"execution_count": 22,
Expand Down
Loading

0 comments on commit 2ffe6ad

Please sign in to comment.