Skip to content
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

Make scheduler interfaces private #2331

Merged
merged 3 commits into from Jan 10, 2021

Conversation

ktbarrett
Copy link
Member

@ktbarrett ktbarrett commented Jan 7, 2021

Most of the scheduler methods which are currently "public" (don't start with an underscore) are not safe or reasonable for a user to call under any circumstance and were definitely intended to be private. Stubs remain in place of the original name to throw deprecation warnings. The interfaces not privatized are:

  • add, same thing as cocotb.fork.
  • create_task , is a staticmethod so it is safe to call whenever.
  • start_soon, designed to be user facing.

It is intended that the stubs will be removed in 2.0.

xref #2278.

@ktbarrett ktbarrett added the type:cleanup cleanup or refactoring on code, documentation, or other areas label Jan 7, 2021
@codecov
Copy link

codecov bot commented Jan 7, 2021

Codecov Report

Merging #2331 (f84840b) into master (8ff91fa) will decrease coverage by 4.85%.
The diff coverage is 56.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2331      +/-   ##
==========================================
- Coverage   65.88%   61.02%   -4.86%     
==========================================
  Files          51       50       -1     
  Lines        8122     8167      +45     
  Branches     1364     1367       +3     
==========================================
- Hits         5351     4984     -367     
- Misses       2177     2633     +456     
+ Partials      594      550      -44     
Impacted Files Coverage Δ
cocotb/ipython_support.py 0.00% <0.00%> (ø)
cocotb/scheduler.py 71.03% <51.21%> (-2.54%) ⬇️
cocotb/__init__.py 47.24% <66.66%> (ø)
cocotb/decorators.py 88.14% <100.00%> (ø)
cocotb/regression.py 77.50% <100.00%> (ø)
cocotb/share/lib/vhpi/VhpiImpl.cpp 17.40% <0.00%> (-37.03%) ⬇️
cocotb/share/lib/vhpi/VhpiImpl.h 29.41% <0.00%> (-30.59%) ⬇️
cocotb/share/lib/vhpi/VhpiCbHdl.cpp 26.91% <0.00%> (-28.48%) ⬇️
cocotb/handle.py 79.24% <0.00%> (-5.46%) ⬇️
cocotb/share/lib/gpi/GpiCbHdl.cpp 76.00% <0.00%> (-1.34%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ff91fa...f84840b. Read the comment docs.

cocotb/scheduler.py Outdated Show resolved Hide resolved
cocotb/scheduler.py Outdated Show resolved Hide resolved
cocotb/scheduler.py Outdated Show resolved Hide resolved
@ktbarrett
Copy link
Member Author

Should I create a newsfragment for #2278? I don't think I should list every change because in the end there may be a lot.

@marlonjames
Copy link
Contributor

I think a summary newsfragment would be good. We can link to the individual PRs from that issue if we want to track all of the changes.

Co-authored-by: Colin Marquardt <cmarqu42@gmail.com>
@ktbarrett ktbarrett merged commit e6a308e into cocotb:master Jan 10, 2021
@ktbarrett ktbarrett deleted the cleanup-private-public branch January 10, 2021 00:28
cmarqu pushed a commit to cmarqu/cocotb that referenced this pull request Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:cleanup cleanup or refactoring on code, documentation, or other areas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants