Repository navigation
Conversation
Comment on lines
+19
to
+26
| from flint import fmpq, fmpq_mpoly_ctx | ||
|
|
||
| ctx = fmpq_mpoly_ctx.get(("x", "y"), "lex") | ||
| p = ctx.from_dict({ | ||
| (1, 1): fmpq(1, 3), | ||
| (1, 0): fmpq(1, 2), | ||
| (0, 1): fmpq(3, 4), | ||
| }) |
Collaborator
There was a problem hiding this comment.
It would be better to say
x, y = ctx.gens()
p = x*y/3 + x/2 + 3*y/4
and to display the polynomial in a doctest.
Comment on lines
+27
to
+31
| >>> p = ctx.from_dict({ | ||
| ... (1, 1): fmpq(1, 3), | ||
| ... (1, 0): fmpq(1, 2), | ||
| ... (0, 1): fmpq(3, 4), | ||
| ... }) |
Collaborator
There was a problem hiding this comment.
This should print out what p is so that someone reading the docs can interpret the dict format.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a worked rational-coefficient example before the fmpq_mpoly API listings. Construct p = xy/3 + x/2 + 3y/4 from ctx.gens() and display the polynomial in a doctest transcript. Then give the equivalent coefficient dictionary and explain its exponent tuples, exact rational coefficients, nonnegative exponents and nonzero denominators.
Related to #268 and the maintainer's suggestion to use non-integer rational examples. The coefficient-domain wording was already corrected in #320.
Validation: fresh full baseline and revised Sphinx HTML renders both generated HTML and exited 1 with the same existing definition-list warning in flint.types._gr.gr_ctx.factor. Both used -b html -W --keep-going -E -a with the repository configuration. This is not a clean strict build. The generated text and mathematical markup were inspected from disk. Autodoc imported the published python-flint 0.9.0 binary; the native checkout was not rebuilt. The displayed transcript was derived from source inspection and was not executed locally. No local software test suites, doctests or example programs were run.