-
Notifications
You must be signed in to change notification settings - Fork 32
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
don't create schema for terms that already have them #103
Conversation
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
==========================================
- Coverage 84.49% 84.31% -0.19%
==========================================
Files 8 8
Lines 458 459 +1
==========================================
Hits 387 387
- Misses 71 72 +1
Continue to review full report at Codecov.
|
4 similar comments
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
==========================================
- Coverage 84.49% 84.31% -0.19%
==========================================
Files 8 8
Lines 458 459 +1
==========================================
Hits 387 387
- Misses 71 72 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
==========================================
- Coverage 84.49% 84.31% -0.19%
==========================================
Files 8 8
Lines 458 459 +1
==========================================
Hits 387 387
- Misses 71 72 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
==========================================
- Coverage 84.49% 84.31% -0.19%
==========================================
Files 8 8
Lines 458 459 +1
==========================================
Hits 387 387
- Misses 71 72 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
==========================================
- Coverage 84.49% 84.31% -0.19%
==========================================
Files 8 8
Lines 458 459 +1
==========================================
Hits 387 387
- Misses 71 72 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
==========================================
- Coverage 84.71% 84.07% -0.64%
==========================================
Files 8 8
Lines 458 471 +13
==========================================
+ Hits 388 396 +8
- Misses 70 75 +5
Continue to review full report at Codecov.
|
ac912d9
to
b76f653
Compare
Is there a reason why we can't just use |
Not really, although having a wrapper type allows for more convenience constructors (e.g., if you use symbols as keys in your constructor instead of |
But aren't symbols accepted already in dicts? That can be handled when applying the schema. |
At the moment you can pass a dict with symbol keys and it'll choke since Anyway, I'm not really wedded to using a wrapper type (and in fact I tried to avoid it originally, using a vanilla dict), but having something concrete that's easy to dispatch on makes it much easier to avoid method ambiguities which were becoming a big headache for |
OK. One solution would be to have terms and symbols compare and hash equal (so that they can be used interchangeably in dicts), but I guess you wouldn't want that. |
possible fix for #97
method ambiguity error though
7465936
to
b8fb638
Compare
Co-Authored-By: Milan Bouchet-Valat <nalimilan@club.fr>
possible fix for #97: don't generate schema entries for terms that don't need schema setting (so categorical, continuous, intercept).
The alternative is to specify
concrete_term
method likeconcrete_term(t, d, hint) = t
that just passes anything through that's not aTerm
. I'm pretty sure these are functionally basically equivalent, but maybe not.@oxinabox
EDIT: I also added a reproducer and fix for #95, which required a wrapper type
Schema
in order to avoid method ambiguities inapply_schema
.