PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
261 stars 206 forks source link

Codelens/Debugging for interactive code #601

Open Pelonza opened 7 years ago

Pelonza commented 7 years ago

This may relate well to #296 --

There's another ML/style for writing interactive textbooks called "Runestone" . They've got a really neat feature called Codelens. It allows interactive step-by-step execution of code in various languages (and even embedded questions).

I know that you can do this when running a full-fledge sagemathcloud instance (step line by line), although some of the other debugging-like features might not be as readily available (variable watching for example). Would it be possible to pull/integrate the codelens mark-up frome Runestone into mathbook xml's html version? (I have NO idea how complicated this would be). It could move mathbook xml much more cleanly into other disciplines for use then. And allow authors that are in interdisciplinary fields to avoid learning multiple markup languages.

rbeezer commented 7 years ago

Dear Karl,

Thanks for the suggestion. It looks like CodeLens is built with PyTutor, though perhaps there are some additional benefits, such as embedding a question. Conceivably, we could embed PyTutor into a WeBWorK problem and ask as many questions as we wanted (so @Alex-Jordan might be interested).

Does this look like the sort of thing you'd like to see?

http://mathbook.pugetsound.edu/beta/pytutor-20170620/section-interesting.html

Rob

Pelonza commented 7 years ago

Yep. That's exactly what I'd like to see. My apologies if I missed that example the first time around looking through the documents!

I don't mind not having an embedded question, though as you said, it could get embedded in a webworks framework (or afterwards) with multiple questions then.

================================================== To schedule a meeting or appointment try: https://karlrbschmitt.youcanbook.me/

Dr. Karl Schmitt Assistant Professor Department of Mathematics and Statistics Department of Computing and Information Sciences Director of Data Science Program Director of Analytics and Modeling Graduate Program Valparaiso University, Indiana

On Tue, Jun 20, 2017 at 11:08 AM, Rob Beezer notifications@github.com wrote:

Dear Karl,

Thanks for the suggestion. It looks like CodeLens is built with PyTutor, though perhaps there are some additional benefits, such as embedding a question. Conceivably, we could embed PyTutor into a WeBWorK problem and ask as many questions as we wanted (so @Alex-Jordan https://github.com/alex-jordan might be interested).

Does this look like the sort of thing you'd like to see?

http://mathbook.pugetsound.edu/beta/pytutor-20170620/ section-interesting.html

Rob

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/601#issuecomment-309808422, or mute the thread https://github.com/notifications/unsubscribe-auth/AMRGU1k0Ats9dxu9zXpoHintzak1ALIUks5sF-6DgaJpZM4N_vDE .

Pelonza commented 7 years ago

A related question (that may be way beyond mathbook's scope) ... does the pytutor framework work with R? (like the sage-cell specifications?)

The links included doesn't seem to include R as an option (I'll need to work some myself to understand how pytutor and the sagecells/webworks might interact).

================================================== To schedule a meeting or appointment try: https://karlrbschmitt.youcanbook.me/

Dr. Karl Schmitt Assistant Professor Department of Mathematics and Statistics Department of Computing and Information Sciences Director of Data Science Program Director of Analytics and Modeling Graduate Program Valparaiso University, Indiana

On Tue, Jun 20, 2017 at 11:27 AM, Karl Schmitt karl.schmitt@valpo.edu wrote:

Yep. That's exactly what I'd like to see. My apologies if I missed that example the first time around looking through the documents!

I don't mind not having an embedded question, though as you said, it could get embedded in a webworks framework (or afterwards) with multiple questions then.

================================================== To schedule a meeting or appointment try: https://karlrbschmitt.youcanbook.me/

Dr. Karl Schmitt Assistant Professor Department of Mathematics and Statistics Department of Computing and Information Sciences Director of Data Science Program Director of Analytics and Modeling Graduate Program Valparaiso University, Indiana

On Tue, Jun 20, 2017 at 11:08 AM, Rob Beezer notifications@github.com wrote:

Dear Karl,

Thanks for the suggestion. It looks like CodeLens is built with PyTutor, though perhaps there are some additional benefits, such as embedding a question. Conceivably, we could embed PyTutor into a WeBWorK problem and ask as many questions as we wanted (so @Alex-Jordan https://github.com/alex-jordan might be interested).

Does this look like the sort of thing you'd like to see?

http://mathbook.pugetsound.edu/beta/pytutor-20170620/section -interesting.html

Rob

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/601#issuecomment-309808422, or mute the thread https://github.com/notifications/unsubscribe-auth/AMRGU1k0Ats9dxu9zXpoHintzak1ALIUks5sF-6DgaJpZM4N_vDE .

rbeezer commented 7 years ago

You did not miss it, I just hacked it up now as proof-of-concept. Enough to demonstrate to me that we could support this with variations of current techniques. There would need to be some side-processing (perhaps via the mbx script) to generate the JSON trace file, but for Python anyway this looks trivial (it is just another Python program to do this).

I'll post a pointer at the Google Group for interested parties who might miss it here.

Do you have a project that would use this? Up to my eyeballs with new ideas and maintenance, but also just starting sabbatical leave. The best way for me to develop new features is to have an interested tester with a real project. Does that describe you? ;-)

On 06/20/2017 09:27 AM, Karl R. B. Schmitt wrote:

Yep. That's exactly what I'd like to see. My apologies if I missed that example the first time around looking through the documents!

I don't mind not having an embedded question, though as you said, it could get embedded in a webworks framework (or afterwards) with multiple questions then.

================================================== To schedule a meeting or appointment try: https://karlrbschmitt.youcanbook.me/

Dr. Karl Schmitt Assistant Professor Department of Mathematics and Statistics Department of Computing and Information Sciences Director of Data Science Program Director of Analytics and Modeling Graduate Program Valparaiso University, Indiana

On Tue, Jun 20, 2017 at 11:08 AM, Rob Beezer notifications@github.com wrote:

Dear Karl,

Thanks for the suggestion. It looks like CodeLens is built with PyTutor, though perhaps there are some additional benefits, such as embedding a question. Conceivably, we could embed PyTutor into a WeBWorK problem and ask as many questions as we wanted (so @Alex-Jordan https://github.com/alex-jordan might be interested).

Does this look like the sort of thing you'd like to see?

http://mathbook.pugetsound.edu/beta/pytutor-20170620/ section-interesting.html

Rob

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/601#issuecomment-309808422, or mute the thread

https://github.com/notifications/unsubscribe-auth/AMRGU1k0Ats9dxu9zXpoHintzak1ALIUks5sF-6DgaJpZM4N_vDE .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/601#issuecomment-309813583, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy2cijPxJ5JVTmHhnPBIFpjmyvTt-g_ks5sF_LggaJpZM4N_vDE.

Pelonza commented 7 years ago

Yep. A colleague and I are starting to write an Introduction to Data Science book/resource site, where we'd really like to incorporate interactive code elements.

Having literally just finished refreshing our plan for the project... we've both got a course in the next AY where we'd like to use our created resource... but neither of us thinks we could finished a full-fledge book by the time we'd want it.

So... we'd be looking to make use/incorporate these sorts of features over the next month or two initially (i.e. start trying to write some MBX with it in), and really put them through their paces over the next calendar year.

================================================== To schedule a meeting or appointment try: https://karlrbschmitt.youcanbook.me/

Dr. Karl Schmitt Assistant Professor Department of Mathematics and Statistics Department of Computing and Information Sciences Director of Data Science Program Director of Analytics and Modeling Graduate Program Valparaiso University, Indiana

On Tue, Jun 20, 2017 at 11:38 AM, Rob Beezer notifications@github.com wrote:

You did not miss it, I just hacked it up now as proof-of-concept. Enough to demonstrate to me that we could support this with variations of current techniques. There would need to be some side-processing (perhaps via the mbx script) to generate the JSON trace file, but for Python anyway this looks trivial (it is just another Python program to do this).

I'll post a pointer at the Google Group for interested parties who might miss it here.

Do you have a project that would use this? Up to my eyeballs with new ideas and maintenance, but also just starting sabbatical leave. The best way for me to develop new features is to have an interested tester with a real project. Does that describe you? ;-)

On 06/20/2017 09:27 AM, Karl R. B. Schmitt wrote:

Yep. That's exactly what I'd like to see. My apologies if I missed that example the first time around looking through the documents!

I don't mind not having an embedded question, though as you said, it could get embedded in a webworks framework (or afterwards) with multiple questions then.

================================================== To schedule a meeting or appointment try: https://karlrbschmitt.youcanbook.me/

Dr. Karl Schmitt Assistant Professor Department of Mathematics and Statistics Department of Computing and Information Sciences Director of Data Science Program Director of Analytics and Modeling Graduate Program Valparaiso University, Indiana

On Tue, Jun 20, 2017 at 11:08 AM, Rob Beezer notifications@github.com wrote:

Dear Karl,

Thanks for the suggestion. It looks like CodeLens is built with PyTutor, though perhaps there are some additional benefits, such as embedding a question. Conceivably, we could embed PyTutor into a WeBWorK problem and ask as many questions as we wanted (so @Alex-Jordan https://github.com/alex-jordan might be interested).

Does this look like the sort of thing you'd like to see?

http://mathbook.pugetsound.edu/beta/pytutor-20170620/ section-interesting.html

Rob

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/rbeezer/mathbook/issues/601#issuecomment-309808422 , or mute the thread

https://github.com/notifications/unsubscribe-auth/ AMRGU1k0Ats9dxu9zXpoHintzak1ALIUks5sF-6DgaJpZM4N_vDE .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/601#issuecomment-309813583, or mute the thread https://github.com/notifications/unsubscribe-auth/ ABy2cijPxJ5JVTmHhnPBIFpjmyvTt-g_ks5sF_LggaJpZM4N_vDE.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/601#issuecomment-309816745, or mute the thread https://github.com/notifications/unsubscribe-auth/AMRGUx2ANqGNVVmNunBZfF57S5QwqDhlks5sF_WHgaJpZM4N_vDE .

rbeezer commented 7 years ago

On 06/20/2017 09:31 AM, Karl R. B. Schmitt wrote:

A related question (that may be way beyond mathbook's scope) ... does the pytutor framework work with R? (like the sage-cell specifications?)

All I see is a reference to "js, ts, ruby, java, c, cpp" (and have no idea what "ts" is!).

The links included doesn't seem to include R as an option (I'll need to work some myself to understand how pytutor and the sagecells/webworks might interact).

Sage Cell Server supports code for R, and we support indicating that a block of code meant for Sage is actually R code. I've never single-stepped anything in CoCalc (nee SageMathCloud), but if I ever got a conversion going to Jupyter notebooks, I guess that would be a possibility?

WeBWorK problems can embed the SageCellServer and presumably that works within a PreTeXt (nee MathBook) document, but I'm not sure we have an example.

rbeezer commented 7 years ago

Yep. A colleague and I are starting to write an Introduction to Data Science book/resource site, where we'd really like to incorporate interactive code elements.

Sounds good. I'm just coming off a very busy two months, but I think this is semi-straightforward, so I'll see what I can do.

Having literally just finished refreshing our plan for the project... we've both got a course in the next AY where we'd like to use our created resource... but neither of us thinks we could finished a full-fledge book by the time we'd want it.

My experience is that you can make the most progress while teaching the course, so you might be surprised by how much you can accomplish in the next 12 months. Maybe not finish, but get a good core together.

So... we'd be looking to make use/incorporate these sorts of features over the next month or two initially (i.e. start trying to write some MBX with it in), and really put them through their paces over the next calendar year.

Pelonza commented 7 years ago

On Tue, Jun 20, 2017 at 12:17 PM, Rob Beezer notifications@github.com wrote:

On 06/20/2017 09:31 AM, Karl R. B. Schmitt wrote:

A related question (that may be way beyond mathbook's scope) ... does the pytutor framework work with R? (like the sage-cell specifications?)

All I see is a reference to "js, ts, ruby, java, c, cpp" (and have no idea what "ts" is!).

I also have no idea what "ts" is...shrug

The links included doesn't seem to include R as an option (I'll need to work some myself to understand how pytutor and the sagecells/webworks might interact).

Sage Cell Server supports code for R, and we support indicating that a block of code meant for Sage is actually R code. I've never single-stepped anything in CoCalc (nee SageMathCloud), but if I ever got a conversion going to Jupyter notebooks, I guess that would be a possibility?

Yes, jupyter notebooks would be another alternative to allow line-by-line step through of code (though I suppose without the nifty stack tracing for python).

Re: Below... nifty. :)

WeBWorK problems can embed the SageCellServer and presumably that works within a PreTeXt (nee MathBook) document, but I'm not sure we have an example.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/601#issuecomment-309827224, or mute the thread https://github.com/notifications/unsubscribe-auth/AMRGU75s9KXnGcm8qgpalNsmWWEUGO1Kks5sF_6TgaJpZM4N_vDE .

Alex-Jordan commented 7 years ago

https://en.wikipedia.org/wiki/TypeScript

Alex-Jordan commented 4 years ago

I am reviewing issues that have any connection to WeBWorK.

In December 2019, there was a workshop where PreTeXt developers and Brad Miller (Runestone creator) were present. Some collaboration was accomplished and more is planned. IIRC Rob got a codelens thingy implemented in PreTeXt, but I'm not finding it right now, so perhaps it is still on a branch unmerged.

Anyway, I thought I'd post here that recent developments are relevant to this old thread.