JuliaInterop / JuliaInterop/JuliaCall

Displaying real-time feedbacks during function execution

Open
#231 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
287
Forks
43
PR merge metrics
No merged PRs in 30d

Description

I have to write a complex function in Julia, an algorithm to fit a bayesian model, and then test it using datasets on R. I would like to "send feedbacks" to the user about the current state of the algorithm, for example by simply printing at which iteration we are. However I didn't find any way to receive (in real time, i.e. during the execution of that function, not all the strings at once only at the end of the run) the outputs of the print/show/display statements from the Julia code into.
So how can I solve this?
I read about using Rprintf, in other issues, but I did not undertand how to actually implement it and if it would work for this case.

For example I was testing something like this

function my_example(iters::Integer)
	result = 0.0
	for i in 1:iters
		print("iteration $i of $iters\r")
		# do my heavy work
		result += rand() # for example
		sleep(0.02)
	end
	return result
end

But all those feedbacks about the count get displayed only at the end of the execution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No project files or tests are named. Start by reproducing the Julia example through JuliaCall and read the existing Rprintf-related implementation or issues; done means feedback from print/show/display is delivered to R during execution rather than only after the function returns.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia, r
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.