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

fix creating dict with JIT disabled #4921

Merged
merged 4 commits into from Dec 19, 2019
Merged

Conversation

esc
Copy link
Member

@esc esc commented Dec 3, 2019

When using NUMBA_DISABLE_JIT=1 we still want dictobject.new_dict to
work, for example to measure coverage and such things.

When using `NUMBA_DISABLE_JIT=1` we still want `dictobject.new_dict` to
work, for example to measure coverage and such things.
@seibert
Copy link
Contributor

seibert commented Dec 10, 2019

Seems reasonable to me.

@seibert seibert added 5 - Ready to merge Review and testing done, is ready to merge 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review 5 - Ready to merge Review and testing done, is ready to merge labels Dec 10, 2019
@seibert
Copy link
Contributor

seibert commented Dec 10, 2019

Following on Stuart's suggestion from #4920, the test could be made to more directly verify the DISABLE_JIT behavior with this test pattern:

def test_jit(self):
with override_config('DISABLE_JIT', True):
with forbid_codegen():
cfunc = jit(nopython=True)(simple_nopython)
self.assertPreciseEqual(cfunc(2), 3)

* master: (252 commits)
  Use class name in the tuple type name
  Fix tuple type used for stararg
  Remove deadcode
  Fix test failure depending on pointer size
  Revert "Replace `arange` with `ones`"
  Revert "Fix arange type in list tests"
  Respond to feedback
  Add problematic case for tuple in stararg
  Attempt to fix numba#4944
  Implement sort/sorted with key.
  Clarify comments
  Use guarded function
  Apply suggestions from code review
  Undo "fix" to block-0 loop header because it is causing segfault in numba.tests.test_closure.TestObjmodeFallback.test_issue3239.
  Fixes a bug in the relabelling logic in literal_unroll.
  Set the calltype on the newly formed SetItem when we replace StaticSetItem with regular SetItem.
  Fix the extraction of code to common function gen_wrap_if_not_known.
  Clean up
  Update looplifting test that now improved in py2 because of the new loop-canonicalization pass
  Fix test error on windows
  ...
This implements most methods for creating typed-dicts with JIT disabled
and tests those.
@esc
Copy link
Member Author

esc commented Dec 19, 2019

So the dictobject.new_dict and Dict.empty 'constructors' work now. Dict() also works with the JIT disabled but returns a Dict instance rather than a dict instance. While this might look O.K. from a testing perspective, any attempt to mutate the Dict instance when DISABLE_JIT is active will most likely lead to an error, so the test for that is an expected failure for now.

When using `Dict()` with DISABLE_JIT we now return a `dict` which should
then survive any kind of mutation.
@esc
Copy link
Member Author

esc commented Dec 19, 2019

Fixed Dict too cc @seibert

@esc esc added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Dec 19, 2019
@seibert seibert added 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Dec 19, 2019
@seibert
Copy link
Contributor

seibert commented Dec 19, 2019

looks good!

@seibert seibert merged commit 67b8fdb into numba:master Dec 19, 2019
@esc esc deleted the typed_dict/fix_no_jit branch December 20, 2019 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge Review and testing done, is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants