Skip to content

Add Dotnet interactive extension#547

Merged
kMutagene merged 8 commits intomasterfrom
interactive
Jun 27, 2022
Merged

Add Dotnet interactive extension#547
kMutagene merged 8 commits intomasterfrom
interactive

Conversation

@kMutagene
Copy link
Copy Markdown
Member

@kMutagene kMutagene commented Mar 19, 2022

This PR adds a .NET interactive extension for deedle. This means you can end cells in .NET notebooks with a frame or series and you get a nicely formatted table.

This PR also adds column slicing to the standard formatting, as well as a function that returns the formatted strings per cell for usage in the extension.

I had to introduce new interfaces (IFrameFormattable, ISeriesFormattable) because dotnet interactive does not seem to be able to register formatters for e.g. Frame<_,_> without type annotation.

I also had to use strings instead of the html DSL of Dotnet.Interactive.Formatting.FSharp because that would need .NET 6, which is not supported due to global.json of this project.

See the poc notebook here: https://github.com/fslaborg/Deedle/blob/interactive/src/Deedle.Interactive/test.ipynb

done:

  • Add max col display for frame formatting
  • Frame formatting as table in .NET interactive
  • set up a test notebook and repack workflow for the expansion
  • series formatter for .NET interactive

still to do:

  • formatting tests
  • use paket for the project (to have the exact same workflow as all the other projects in this solution)
    For this, i also updated paket and added new build targets/metadata

@kMutagene
Copy link
Copy Markdown
Member Author

I know that there is also https://github.com/WalternativE/Deedle.DotNet.Interactive.Extension but it seems not to be updated and i am too stupid to understand the code there, so i made this instead. It adapts and extends some Deedle internals instead of working on the IFsiFormattable interface. @WalternativE i would love your feedback on this. Are you still planning on working on that repo? maybe we can bundle efforts here.

@WalternativE
Copy link
Copy Markdown

I know that there is also https://github.com/WalternativE/Deedle.DotNet.Interactive.Extension but it seems not to be updated and i am too stupid to understand the code there, so i made this instead. It adapts and extends some Deedle internals instead of working on the IFsiFormattable interface. @WalternativE i would love your feedback on this. Are you still planning on working on that repo? maybe we can bundle efforts here.

Would be lovely to have something in the main repo. I didn't commit anything at this place because there were still open design questions and because of the 'unstable' nature of the .NET Interactive extension API. @kMutagene if there are problems with my extension, please feel free to open an issue. I'm currently daily driving R and Python (or F# in server code) so I'm pretty slow at recognizing if something breaks :/

@zyzhu
Copy link
Copy Markdown
Contributor

zyzhu commented Mar 21, 2022

@kMutagene, this looks awesome. As for global.json, that was just intended to keep all the dependencies working together. Feel free to get this upgraded to dotnet 6 if you get a chance, especially if you can get the docs revived with latest fsdocs tools.

Due to change of work obligation, I have much less time available on my hands to work on this. I trust that the repo is in great hands. 👍

@kMutagene
Copy link
Copy Markdown
Member Author

@AndrewIOM is there more to do locally than install R 4.0.2 and create a R_HOME variable (which in my case points at C:\Program Files\R\R-4.0.2\bin) for building the RPlugin? It does not work for me. As a temporary fix, i have created build targets that ignore the RPlugin project. I will release this as beta packages once it's merged until this is figured out.

@kMutagene kMutagene marked this pull request as ready for review June 27, 2022 12:50
@kMutagene kMutagene merged commit ffa0af9 into master Jun 27, 2022
@nhirschey
Copy link
Copy Markdown

nhirschey commented Jun 27, 2022

Update: Sorry, just noticed that RProvider is building on windows CI. Ignore everything below. Sorry!

@kMutagene FYI, regarding RProvider, I also noticed some issues building on windows (fslaborg/RProvider#253). When I looked into it, my best guess for what changed from when I was previously able to build on windows was the runtime identifier change in RProvider.Server that was changed to be osx-64 see here.

I don't know, but it's possible that it blocks successful windows builds. I didn't investigate further.

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.

4 participants