sizespectrum / mizerExperimental

Extends the mizer package with experimental features
https://sizespectrum.org/mizerExperimental/
3 stars 5 forks source link

Adding more resources to tuneParams #40

Closed baldrech closed 2 years ago

baldrech commented 2 years ago

This pull request aims to make tuneParams compatible with mizerMR objects. The interface has been updated to include a slider for the different resources. Calls to plot involving resources have been replaced by their mizerMR version which can handle both standard and multiple resources objects.

Cheers,

R

baldrech commented 2 years ago

I moved everything in resourceControl.R. To initialise input$re I use a is.null() case where the slider is created for the first time, this triggers output$sp_params UI to reload with the slider and the resource's parameter this time. To stop the slider to reset itself when output$sp_params reloads, the default value of the slider is input$re itself, which feels weird but it works.

baldrech commented 2 years ago

Hi Gustav, I made all the changes you requested. Can you merge or did I miss something?

baldrech commented 2 years ago

Using the Tasman Sea parameter set, the equation rate * capacity / (rate + mu) creates 0/0 division at highest sizes and therefore adds NaN to the initial resource. Last commit solve that. Is it normal to get that in the first place though?

Also, is the minimum size class for resources hard coded (currently 10e-10)?. This also creates an error with the Tasman sea since one of the resource is set up to go as low as 10e-11.

gustavdelius commented 2 years ago

I have been out of this for a while. So please remind me. This is code for having a resource control that works with mizerMR. Should this not therefore go into the mizerMR package? I am sure we had a good reason to think it should go into mizerExperimental.

baldrech commented 2 years ago

Yes this code changes tuneParams so it can handle mizerMR objects. I'm guessing it's easier to have it here in mizerExperimental instead of adding a tweaked tuneParams to mizerMR.

The best approach would be to merge this pull request into a specific branch for mizerMR users so they can use this code until mizerMR becomes officially part of mizer. I will let you create a new branch and I'll do it the pull request on it.

gustavdelius commented 2 years ago

Sorry for the delay. I have created a branch 'mizerMR' and I have also given you write privileges so that in future you can create branches as well.