Skip to content

Add Learner.new() method that returns an empty copy of the learner #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

basnijholt
Copy link
Member

@basnijholt basnijholt commented Oct 9, 2022

Description

Add a method that returns a new instance of the Learner but without any data.

This is useful for testing and very useful when sending Learners over the network where its data is stored separately, e.g., in https://github.com/basnijholt/adaptive-scheduler.

Checklist

  • Fixed style issues using pre-commit run --all (first install using pip install pre-commit)
  • pytest passed

Type of change

Check relevant option(s).

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • (Code) style fix or documentation update
  • This change requires a documentation update

@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2022

Codecov Report

Merging #365 (0f77ca5) into master (914495c) will increase coverage by 0.01%.
The diff coverage is 91.42%.

@@            Coverage Diff             @@
##           master     #365      +/-   ##
==========================================
+ Coverage   80.20%   80.22%   +0.01%     
==========================================
  Files          37       37              
  Lines        5334     5359      +25     
  Branches      975      976       +1     
==========================================
+ Hits         4278     4299      +21     
- Misses        890      891       +1     
- Partials      166      169       +3     
Impacted Files Coverage Δ
adaptive/learner/base_learner.py 88.37% <50.00%> (-1.88%) ⬇️
adaptive/learner/integrator_learner.py 88.32% <66.66%> (-0.20%) ⬇️
adaptive/learner/skopt_learner.py 59.42% <75.00%> (+0.95%) ⬆️
adaptive/learner/average_learner.py 84.03% <100.00%> (+0.27%) ⬆️
adaptive/learner/average_learner1D.py 77.66% <100.00%> (-0.53%) ⬇️
adaptive/learner/balancing_learner.py 75.34% <100.00%> (+0.34%) ⬆️
adaptive/learner/data_saver.py 87.09% <100.00%> (+0.43%) ⬆️
adaptive/learner/learner1D.py 89.52% <100.00%> (+0.05%) ⬆️
adaptive/learner/learner2D.py 78.89% <100.00%> (+0.13%) ⬆️
adaptive/learner/learnerND.py 60.40% <100.00%> (+0.14%) ⬆️
... and 5 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@basnijholt basnijholt changed the title Add Learner.new() method that returns the same but empty learner Add Learner.new() method that returns an empty copy of the learner Oct 11, 2022
@basnijholt basnijholt merged commit 0464abe into master Oct 11, 2022
@basnijholt basnijholt deleted the new branch October 11, 2022 00:11
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.

2 participants