Coder Social home page Coder Social logo

Comments (5)

callistosp avatar callistosp commented on May 26, 2024

Update: this appears to be related to a change in the last PR into develop. Even when importing the results from the completed model, it still thinks the model did not run and looks for OUTPUT.

> restest <- rbabylon::import_result(file.path(MODEL_DIR, "101.yaml")) 
> restest %>% model_summary(.wait=0) 
/data/rbabylon-example-project/model/pk/101/101.ext file does not look finished but there is also no `101/OUTPUT` file. Your run may have failed. 
--- 
Model is still running. Tail of `101/OUTPUT` file:  
---
FALSEError in nonmem_summary(.res, ...) :    101.ctl is not finished and 0 second wait time has elapsed. Check back later or increase `.wait`.
--

 
  |  
 

from bbr.

dpastoor avatar dpastoor commented on May 26, 2024

seth and i discussed that this morning some, I think this model_summary needs an overhaul.

Here is what I am thinking - model_summary() should only work if the model is completed.

  1. we need to define how we can reliably detect completion, as quickly as possible. For example scanning the entire ext file for -1000000 lines means reading that entire file, which could be quite large.

  2. It should just return either a model result, or print a message saying model not completed, no summary avialable, and return NULL

  3. we need to separately provide monitoring functions that can handle whatever waiting the scientist may want

spec %>% submit_model() %>% wait_until_complete() %>% summarize_model()

the reason that waiting should be moved outside of specific submission is this allows composability and other customization. For example, maybe we want to provide a wait function that also has enough logic to know about failures - basically a specific tryCatch

spec %>% submit_model() %>% 
    wait_until_complete(error = function(e) {
       # some details of what to do if error occurs
    }) %>% 
    summarize_model()

from bbr.

callistosp avatar callistosp commented on May 26, 2024

that seems like a reasonable expectation to me. if you're pulling out wait_until_complete, it would also be nice to have a wait_until_starts. e.g. if I'm shooting off some runs overnight before I leave work, I would run spec %>% submit_model %>% wait_until_starts() to verify that the run started before I shutdown my workflow

from bbr.

seth127 avatar seth127 commented on May 26, 2024

@callistosp this will be closed when the linked PR merges. The fix is that model_summary() just stops with an informative error if it can't get a summary (see tests mentioned below). We are intending to make a better version of check_nonmem_progress() in a future release, and this will be incorporated into model_summary() under the hood.

If you have thoughts on how you would like that to work, like some of the ones you put in the comments above, you can open a new issue with the desired functionality and tag it with the milestone roadmap.

Tests

  • tests/testthat/test-summary.R
    • model_summary() fails predictably if it can't find some parts (i.e. model isn't finished)
    • model_summary() fails predictably if no .lst file present

from bbr.

seth127 avatar seth127 commented on May 26, 2024

We're closing this because there is another issue to deal with this:
#31

from bbr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.