Code Monkey home page Code Monkey logo

Comments (8)

rohitsanj avatar rohitsanj commented on June 19, 2024 1

Hey, thanks for raising this issue. I think it definitely makes sense to gather all cells with the same tag. I will take this up.

Edit: Seems like there are a few edge cases where gathering all cells with same tag would not make sense, I will document these and come up with a solution soon and post it here.

from testbook.

rohitsanj avatar rohitsanj commented on June 19, 2024 1

@devstein Thanks for the follow up! I apologize for the delay. I will try and implement this over the coming weekend.

from testbook.

fcollonval avatar fcollonval commented on June 19, 2024

@rohitsanj Thanks a lot for the reply. I look forward to hear about your solution.

from testbook.

devstein avatar devstein commented on June 19, 2024

@fcollonval @rohitsanj Any updates on this? A few of user want the ability to separate cells for readability purposes, but group them logically when testing via the same tag

from testbook.

rohitsanj avatar rohitsanj commented on June 19, 2024

So, I ran into some design issues while trying to implement this. Maybe you can give me your feedback on this.

Let's say you have a notebook with cells as:

cell 0 ('tag1', 'tag2')
cell 1 ('tag3')
cell 2 ('tag2')
cell 3 ('tag1')
cell 4
cell 5 ('tag1')

The issue is as follows: with the current implementation, when we specify testbook('nb.ipynb', execute=['tag3', 'tag1'], it will execute the cells tagged by those tags in the specified order i.e execute cell 1 and then cell 0. If we were to support multiple cells with same tag, we will have to execute the cells linearly, because otherwise the order becomes ambiguous.

For example, if execute=['tag3', 'tag1'] which means tag3 will fetch cells [1] and tag1 will fetch cells [0, 3, 5]
Now, there'd be two ways to go about this:

  • Does the user want testbook to execute all cells tagged by 'tag3' and then, execute all cells tagged with 'tag1' ?
  • OR, Does the user want testbook to execute linearly, which would combine to give [0, 1, 3, 5]

It is these ambiguities that I wanted to highlight earlier. I'd like to hear your thoughts on this. @devstein @fcollonval

cc @MSeal

from testbook.

fcollonval avatar fcollonval commented on June 19, 2024

I would say

the user want testbook to execute linearly, which would combine to give [0, 1, 3, 5]

The unordered execution sounds odd as it means the intrinsic way to execute the notebook is unordered; aka when you run manually the notebook. This is a bad practice that will confuse most users.

from testbook.

devstein avatar devstein commented on June 19, 2024

@rohitsanj I agree with @fcollonval, keeping it linear is most intuitive.

If executing the notebook in a tag-based order is desirable, then I think it makes sense to have a separate execution flag for enabling that behavior.

from testbook.

Uznick avatar Uznick commented on June 19, 2024

@rohitsanj +1 for keeping it linear, as it's consistent with how manual runs work.

from testbook.

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.