-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Feature.require vs. is_present, is_functional #33114
Comments
comment:1
I believe that the original idea was to use this in the build process of SageMath. This influence some of the choices we made back then. If I understand correctly, that's not what we are planning to do anymore. Anyway, |
comment:2
So, Similarly, I believe that the task here is to improve the documentation of these methods if that is not sufficiently clear. |
comment:3
Ok, this is how I understood the feature code up to today, but the meaning of When we speak with someone verbally, it is possible that we observe for example as in #33092 that imagemagick is "installed" on a machine, thus the convert command "is present", but it "is not functional" because it can't handle PNG files for instance. In real life, it happens that a feature is present but not functional. This is why the current design is weird a little (but probably easy to fix, for example by adding a new method What I realised today in #33092 comment:20 is that JoinFeature currently does not follow the same behavior with respect to |
comment:4
Replying to @seblabbe:
I'd propose to rename
Yes, that is a bug in |
comment:5
I agree with all of the above - except that it's perhaps not necessary to do the renaming |
comment:6
Replying to @mkoeppe:
I agree, I was thinking the same. When Maybe the |
comment:7
Replying to @seblabbe:
So, I don't think you need both
Currently, require says |
comment:8
Replying to @saraedum:
+1 |
comment:9
Replying to @saraedum:
Well, the full context of that line is Or, maybe, I am wrong on the meaning of the word |
comment:10
Given that features map to |
comment:11
If there is an actual use case for distinguishing different levels of "presence" for a feature (present, functional, awesome, spiffy) - then it would be clearer to actually define separate features for these levels. |
comment:12
Replying to @seblabbe:
+1 on better messages where possible, but I don't think it's useful to have a separate exception class. |
comment:13
Thanks for the answers. I agree to keep it simple and binary YES/NO. I do not have use cases for more levels of presence. I allow myself to ask whether I agree that my main point boils down to give good information to the user when |
comment:14
Maybe rename |
comment:16
Replying to @slel:
Personaly, I don't disagree. |
Dependencies: #31292 |
comment:19
Here's a minimal change to improve the situation. Last 10 new commits:
|
Commit: |
Author: Matthias Koeppe |
comment:20
(Last 2 commits only; it is on top of #31292) |
comment:24
(Last 4 commits only; it's on top of #31292.) |
Changed dependencies from #31292 to none |
comment:26
Let's get this in please |
comment:27
works for me. Thanks for this improvement. I think a next step further is, as suggested in comment:14, to rename |
Reviewer: Sébastien Labbé |
comment:28
Thanks! |
Changed branch from u/mkoeppe/feature_require_vs__is_present__is_functional to |
Changed commit from |
comment:30
updated description with choices made in this ticket |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ional deprecated in sagemath#33114 (2022)
…`sage.features`: Remove deprecated methods <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> - Fixes sagemath#35255 Removes methods deprecated in: - sagemath#31292 (2022) - sagemath#33114 (2022) <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37312 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
…`sage.features`: Remove deprecated methods <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> - Fixes sagemath#35255 Removes methods deprecated in: - sagemath#31292 (2022) - sagemath#33114 (2022) <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37312 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
…`sage.features`: Remove deprecated methods <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> - Fixes sagemath#35255 Removes methods deprecated in: - sagemath#31292 (2022) - sagemath#33114 (2022) <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37312 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
…`sage.features`: Remove deprecated methods <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> - Fixes sagemath#35255 Removes methods deprecated in: - sagemath#31292 (2022) - sagemath#33114 (2022) <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37312 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
(addressing slabbe's questions from #33092 comment:23)
Some questions arise with respect to
is_present()
,is_functional()
andrequire()
:Feature.require()
not checkthat
is_functional()
isTrue
?is_present()
always returnFalse
when
is_functional
returnsFalse
(whilethe method names suggest
is_present
couldbe
True
whileis_functional
isFalse
)?Choices made in this ticket:
is_present()
should be called from outsideis_functional()
returns Truerequire()
method only callsis_present()
A further step, not done in this ticket, would be,
as suggested in comment:14, to rename
is_functional
to
_is_functional
, since onlyis_present
is supposedto be used from outside.
CC: @seblabbe @orlitzky @kwankyu @saraedum
Component: refactoring
Author: Matthias Koeppe
Branch:
f9232e8
Reviewer: Sébastien Labbé
Issue created by migration from https://trac.sagemath.org/ticket/33114
The text was updated successfully, but these errors were encountered: