Skip to content

explicit RK docstrings #1866

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

Merged
merged 7 commits into from
Aug 12, 2023
Merged

Conversation

ArnoStrouwen
Copy link
Member

No description provided.

@ArnoStrouwen ArnoStrouwen marked this pull request as draft February 6, 2023 18:52
start_docstring * description * end_docstring
end

@doc explicit_rk_docstring("The second order Heun's method. Uses embedded Euler method for adaptivity.")
Copy link
Member

Choose a reason for hiding this comment

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

That looks nice!

@ArnoStrouwen
Copy link
Member Author

I'm not sure how to get FUNCTIONNAME to work inside a function that defines the docstring.
Currently, it is just doing string interpoloation isntead of working with the @doc marcro.
Capture

@ChrisRackauckas
Copy link
Member

@shashi or @YingboMa how did you manipulate the docs stuff for Symbolics?

@shashi
Copy link

shashi commented Feb 8, 2023

@ChrisRackauckas it was working in old MTK when we split the package.

@ArnoStrouwen
Copy link
Member Author

Do you perhaps know the solution to the above problem @mortenpi?

function explicit_rk_docstring(description::String)
start_docstring = """
```julia
$FUNCTIONNAME(; stage_limiter! = OrdinaryDiffEq.trivial_limiter!,

Choose a reason for hiding this comment

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

You're literally interpolating the string() value of the FUNCTIONNAME object into the string here, hence why it doesn't work. DocStringExtensions takes advantage of the fact that string interpolation in macro calls / docstrings is special, which is how it works in @doc "$FUNCTIONNAME ..." foo situations.

I don't see any way to make this work with DocStringExtensions, but you could, of course, work around it by passing the function name as an extra parameter to explicit_rk_docstring. I would suggest opening an issue at DocStringExtensions though, since this is an interesting case.

Choose a reason for hiding this comment

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

Looks kind of like what @template is for perhaps. If that's stretching what the template macro can actually handle currently it may be possible to improve it's features to handle this case better.

@ArnoStrouwen
Copy link
Member Author

@ChrisRackauckas What does williamson_condition do in ORK256?
Could you write a sentence or 2 describiting it.

@ChrisRackauckas
Copy link
Member

williamson_condition allows for an optimization that allows fusing broadcast expressions with the function call f. However, it only works for Array types.

@ArnoStrouwen ArnoStrouwen changed the title start docstring overhaul explicit RK docstrings Aug 7, 2023
@ArnoStrouwen ArnoStrouwen marked this pull request as ready for review August 7, 2023 12:46
Copy link

@ai-maintainer ai-maintainer bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! 

This pull request is too large for automated review.

Reviewed with AI Maintainer

@ArnoStrouwen
Copy link
Member Author

@ChrisRackauckas Still need input on this and then RK explicit is done atleast.

  • RKM needs a sentence describing the method
    Similar to RK4's:
    Explicit Runge-Kutta Method. The canonical Runge-Kutta Order 4 method. Uses a defect control for adaptive stepping using maximum error over the whole interval.
  • Feagin methods are stubs
  • Euler is a stub
  • KuttaPRK2p5 is a stub

@ChrisRackauckas
Copy link
Member

Test failure looks real

@ChrisRackauckas
Copy link
Member

The v1.9 test failures look real.

@ArnoStrouwen
Copy link
Member Author

The v1.9 test failures look real.

#2008 seems to also have these issues, so probably not related to this PR?

@ChrisRackauckas
Copy link
Member

@ChrisRackauckas
Copy link
Member

That looks fishy https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/5795470854/job/15707118352?pr=1866#step:6:596 . Area all of the test errors known? I know the other ones seem to be from ITP (SciML/DiffEqBase.jl#917 @DaniGlez it would be good to figure out what happened post merge)

@DaniGlez
Copy link

DaniGlez commented Aug 8, 2023

Yeah, looking at the test failure in the Integrators_I suite there's a clear issue with the InternalITP solver, is that the only one?

@ChrisRackauckas
Copy link
Member

Integrators_II, yes that's the only one.

@DaniGlez
Copy link

DaniGlez commented Aug 9, 2023

I took a look, it seems that I simply forgot to port the latest bugfixes from the SimpleNonlinearSolve version to the internal DiffEqBase one. I'll PR a fix soon.

@DaniGlez
Copy link

DaniGlez commented Aug 9, 2023

This should fix it, I believe: SciML/DiffEqBase.jl#919

@ChrisRackauckas ChrisRackauckas merged commit ceecac6 into SciML:master Aug 12, 2023
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.

6 participants