Hom: introduce a check argument to simplify the unpickling detection logic
|Reported by:||nthiery||Owned by:|
|Cc:||SimonKing, tscrim||Merged in:|
|Authors:||Nicolas M. Thiéry, Simon King||Reviewers:||Simon King, Nicolas M. Thiéry|
|Report Upstream:||N/A||Work issues:|
As was noticed in #14793, some sanity checks need to be disabled in Hom when called upon unpickling because the input may include an unitialized parent. Since #14793, this is achieved by looking at the parent to detect if it is unitilialized.
As an alternative, this ticket proposes to add a check=True/False?
optional argument to Hom, and to use it upon unpickling. The advantages are:
- The logic is quite simpler, slightly faster, and more robust.
- This check argument is of general purpose, and indeed immediately put to use when Hom calls itself recursively.
- It made it easier for the first feature below
A potential caveat: pickles created since #14793 might not unpickle
properly. This was very recent; do we care?
Other changes in this ticket:
- Hom now uses X in category as sanity check rather than X.category().is_subcategory(category). This is more expressive, and indeed a necessary preliminary step for #15801 which makes those two idioms not always equivalent (example: X is a QQ-module, X.category() is Modules(Rings) and category is Modules(QQ))
- A bug fix for Homsets between simplicial complexes over some higher category (_Hom_ was not checking its input).
Change History (55)
comment:1 Changed 6 months ago by nthiery
- Branch set to u/nthiery/hom__introduce_a_check_argument_to_simplify_the_unpickling_detection_logic
comment:5 Changed 6 months ago by git
- Commit changed from 1ff993bb8e1af3eaae79255a4b97cc4b5afe39bf to 0074f0259a502a2e7fa6d93f1814c418b8dfb1c1
comment:6 Changed 6 months ago by git
- Commit changed from 0074f0259a502a2e7fa6d93f1814c418b8dfb1c1 to ae3ca8080a8412891722695d1e24e1dfe374d787
Changed 6 months ago by SimonKing
comment:20 Changed 6 months ago by git
- Commit changed from ae3ca8080a8412891722695d1e24e1dfe374d787 to 507ee00f4f1f81680a52cd798d2fd5a03fb4172d
comment:25 Changed 6 months ago by SimonKing
- Branch changed from u/nthiery/hom__introduce_a_check_argument_to_simplify_the_unpickling_detection_logic to u/SimonKing/ticket/16275
- Created changed from 05/01/14 15:40:52 to 05/01/14 15:40:52
- Modified changed from 05/02/14 07:49:06 to 05/02/14 07:49:06
comment:26 Changed 6 months ago by SimonKing
- Commit changed from 507ee00f4f1f81680a52cd798d2fd5a03fb4172d to 76bdaa90610e20d51456db092883ff7c61e5d6c2
- Reviewers set to Simon King
- Status changed from new to needs_review
comment:30 Changed 6 months ago by git
- Commit changed from 76bdaa90610e20d51456db092883ff7c61e5d6c2 to ecc4616852de61a3f1fa62bdf9dc76a61d94aaba
comment:37 Changed 6 months ago by git
- Commit changed from ecc4616852de61a3f1fa62bdf9dc76a61d94aaba to e1e916cde347deac1df9079f7ec856184e3862bf
comment:39 in reply to: ↑ 34 Changed 6 months ago by nthiery
comment:40 Changed 6 months ago by nthiery
- Reviewers changed from Simon King to Simon King, Nicolas M. Thiéry
comment:45 Changed 6 months ago by vbraun
- Branch changed from u/SimonKing/ticket/16275 to e1e916cde347deac1df9079f7ec856184e3862bf
- Resolution set to fixed
- Status changed from positive_review to closed
comment:46 follow-up: ↓ 47 Changed 3 weeks ago by jdemeyer
- Commit e1e916cde347deac1df9079f7ec856184e3862bf deleted