Skip to content

Conversation

sgreenbury
Copy link
Collaborator

@sgreenbury sgreenbury commented Jul 14, 2025

Closes #537.

This PR:

  • Adds TorchDefaultDType = tf.float32 for use as a const across codebase
  • Adds some dtype handling for simulators so that returned y has same dtype as input x

Question:

  • An alternative would be to allow dtype for outputs and inputs of simulator to be set on the __init__ - would this be useful?
  • I replaced .float32 where I think it makes sense but there could be other places such as in tutorials where there is some handling missing.

Copy link
Contributor

github-actions bot commented Jul 14, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  autoemulate/experimental
  types.py
  autoemulate/experimental/data
  utils.py
  autoemulate/experimental/emulators
  polynomials.py
  autoemulate/experimental/learners
  base.py
  autoemulate/experimental/simulations
  base.py 110
  epidemic.py
  experimental_design.py 71
  tests
  test_compare.py
  tests/experimental
  conftest.py
  test_experimental_base_simulator.py
  test_experimental_preprocessors.py
Project Total  

This report was generated by python-coverage-comment-action

@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.22%. Comparing base (cecf95d) to head (11b35b7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #619      +/-   ##
==========================================
+ Coverage   80.20%   80.22%   +0.02%     
==========================================
  Files         155      155              
  Lines       11132    11136       +4     
==========================================
+ Hits         8928     8934       +6     
+ Misses       2204     2202       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sgreenbury sgreenbury force-pushed the 537-add-torch-dtype branch from 0245126 to 851901b Compare July 25, 2025 15:12
@sgreenbury sgreenbury force-pushed the 537-add-torch-dtype branch from 3c2fa17 to 6bf9d2e Compare July 25, 2025 15:37
@sgreenbury sgreenbury marked this pull request as ready for review July 25, 2025 15:37
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add default_dtype option
2 participants