Skip to content

Conversation

@philipc2
Copy link
Member

@philipc2 philipc2 commented Nov 21, 2024

Overview

  • Fixes a Pickle error due to formatted value errors.
  • Adds better checks for checking if a Numba function is compiled

Error


/glade/work/oero/conda-envs/hackathon0/lib/python3.12/site-packages/uxarray/grid/grid.py:1372: RuntimeWarning: Necessary functions for computing face bounds are not translated yet with Numba. This initialtranslation may take some time.
  warn(
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File /glade/work/oero/conda-envs/hackathon0/lib/python3.12/site-packages/numba/core/pythonapi.py:1414, in PythonAPI.serialize_object(self, obj)
   1413 try:
-> 1414     gv = self.module.__serialized[obj]
   1415 except KeyError:

KeyError: (<class 'ValueError'>, (<ir.InsertValue 'inserted.parent.24' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'insertvalue', operands [<ir.InsertValue 'inserted.meminfo.24' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'insertvalue', operands [<ir.InsertValue 'inserted.hash.4' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'insertvalue', operands [<ir.InsertValue 'inserted.is_ascii.4' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'insertvalue', operands [<ir.InsertValue 'inserted.kind.4' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'insertvalue', operands [<ir.InsertValue 'inserted.length.4' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'insertvalue', operands [<ir.InsertValue 'inserted.data.24' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'insertvalue', operands [<ir.Constant type='{i8*, i64, i32, i32, i64, i8*, i8*}' value=<llvmlite.ir.values._Undefined object at 0x153fcde29670>>, <ir.ExtractValue '.9360' of type 'i8*', opname 'extractvalue', operands [<ir.LoadInstr '.9359' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'load', operands [<ir.AllocaInstr '.9345' of type '{i8*, i64, i32, i32, i64, i8*, i8*}*', opname 'alloca', operands ()>]>]>]>, <ir.ExtractValue '.9361' of type 'i64', opname 'extractvalue', operands [<ir.LoadInstr '.9359' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'load', operands [<ir.AllocaInstr '.9345' of type '{i8*, i64, i32, i32, i64, i8*, i8*}*', opname 'alloca', operands ()>]>]>]>, <ir.ExtractValue '.9362' of type 'i32', opname 'extractvalue', operands [<ir.LoadInstr '.9359' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'load', operands [<ir.AllocaInstr '.9345' of type '{i8*, i64, i32, i32, i64, i8*, i8*}*', opname 'alloca', operands ()>]>]>]>, <ir.ExtractValue '.9363' of type 'i32', opname 'extractvalue', operands [<ir.LoadInstr '.9359' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'load', operands [<ir.AllocaInstr '.9345' of type '{i8*, i64, i32, i32, i64, i8*, i8*}*', opname 'alloca', operands ()>]>]>]>, <ir.ExtractValue '.9364' of type 'i64', opname 'extractvalue', operands [<ir.LoadInstr '.9359' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'load', operands [<ir.AllocaInstr '.9345' of type '{i8*, i64, i32, i32, i64, i8*, i8*}*', opname 'alloca', operands ()>]>]>]>, <ir.ExtractValue '.9365' of type 'i8*', opname 'extractvalue', operands [<ir.LoadInstr '.9359' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'load', operands [<ir.AllocaInstr '.9345' of type '{i8*, i64, i32, i32, i64, i8*, i8*}*', opname 'alloca', operands ()>]>]>]>, <ir.ExtractValue '.9366' of type 'i8*', opname 'extractvalue', operands [<ir.LoadInstr '.9359' of type '{i8*, i64, i32, i32, i64, i8*, i8*}', opname 'load', operands [<ir.AllocaInstr '.9345' of type '{i8*, i64, i32, i32, i64, i8*, i8*}*', opname 'alloca', operands ()>]>]>]>,), ('pole_point_inside_polygon', '/glade/work/oero/conda-envs/hackathon0/lib/python3.12/site-packages/uxarray/grid/geometry.py', 830))

During handling of the above exception, another exception occurred:

@philipc2 philipc2 self-assigned this Nov 21, 2024
@philipc2 philipc2 changed the title Fix pickling error in Numba exception handling Fix pickling error in Numba exception handling & improve cache checks Nov 21, 2024
@philipc2 philipc2 merged commit 2f193a4 into main Nov 21, 2024
17 of 18 checks passed
@erogluorhan erogluorhan deleted the philipc2/numba-pickle branch February 5, 2025 21:16
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