Skip to content

Add fraction_field_type and define fraction_field method for fields #2092

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fingolfin
Copy link
Member

Seems natural and I see no harm in it?

Copy link

codecov bot commented May 20, 2025

Codecov Report

Attention: Patch coverage is 81.48148% with 5 lines in your changes missing coverage. Please review.

Project coverage is 88.33%. Comparing base (8ea17bc) to head (11dd456).

Files with missing lines Patch % Lines
src/Fraction.jl 55.55% 4 Missing ⚠️
src/generic/RationalFunctionField.jl 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2092      +/-   ##
==========================================
- Coverage   88.34%   88.33%   -0.01%     
==========================================
  Files         126      126              
  Lines       31674    31679       +5     
==========================================
+ Hits        27982    27984       +2     
- Misses       3692     3695       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lgoettgens
Copy link
Member

Can we then please also have some programmatic way for deciding the type of the fraction field of some ring, i.e. fraction_field_type that usually returns some Generic.FracField{T} thingy, but T for T being a field subtype?

@fingolfin fingolfin changed the title Define fraction_field for fields Define fraction_field for fields May 21, 2025
@fingolfin
Copy link
Member Author

I agree with the idea of adding fraction_field_type, but while looking into it I found a more serious issue:

function fraction_field(a::RationalFunctionField{T, U}) where {T <: FieldElement, U <: Union{PolyRingElem, MPolyRingElem}}
   return a.fraction_field::Union{FracField{U}}
end

And this is also documented, so we can't simply change it.

But I think that kind of throws a wrench into the idea behind this PR sigh; at the very least it would require a breaking release which renames the above fraction_field getter to e.g. underlying_fraction_field (actually I would have expect this to be base_ring, but base_ring on a RationalFunctionField is the base ring / coefficientring of the underlying fraction field / polynomial ring... sigh

@fingolfin fingolfin force-pushed the mh/fraction_field-for-Field branch from 4c14082 to 13c9d7b Compare June 25, 2025 21:27
@fingolfin fingolfin changed the title Define fraction_field for fields Add fraction_field_type and define fraction_field method for fields Jun 25, 2025
@fingolfin fingolfin force-pushed the mh/fraction_field-for-Field branch from 13c9d7b to 97e4466 Compare June 25, 2025 21:33
@fingolfin fingolfin force-pushed the mh/fraction_field-for-Field branch from 97e4466 to 11dd456 Compare June 25, 2025 21:48
@doc raw"""
fraction_field_type(a)

Return the type of the base ring of the given element, element type, parent or parent type $a$.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Return the type of the base ring of the given element, element type, parent or parent type $a$.
Return the type of the fraction field of the given element, element type, parent or parent type $a$.

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