Git Product home page Git Product logo

Comments (4)

hugetim avatar hugetim commented on May 28, 2024

No, but that makes sense that preserve doesn't work, now that you mention it.

Well, does it work if you first run %set echo=False at the top of the notebook?

If not, (A) the explanation is that, behind the scenes, pystata runs each multi-line code cell as if it were a temporary do-file. So, just as running preserve in a do-file doesn't carry over into interactive mode (or another do-file), preserve doesn't carry over across cells.

If so, (B) they've made preserve work across pystata.stata.run calls (as they've apparently done for locals and version) and the reason it's not working is that you were using the (nbstata default) echo=None mode, which is another step more complicated behind the scenes.

Either way, I'd like to fix the issue, if possible. (I routinely use preserve myself, though I apparently hadn't tried it in a notebook yet.) But a solution is not coming immediately to mind.

from nbstata.

ideabucket avatar ideabucket commented on May 28, 2024

Ah, that's it all right! Works fine without echo = None. How unfortunate. But at least that means there's a workaround.

from nbstata.

hugetim avatar hugetim commented on May 28, 2024

Yes, that's good news. That means I should be able to make it work with echo=None, too, then. I've got an idea now: it can be implemented in a different way that I perhaps prematurely judged too complicated.

from nbstata.

hugetim avatar hugetim commented on May 28, 2024

For now, I pushed a temporary fix that just switches any cell with preserve or restore to "echo" mode automatically.

from nbstata.

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.