Coder Social home page Coder Social logo

ashby's Issues

Custom template parameters in batch mode

Lifted from #1 (review)

The main goal is to allow production of plots that differ only in small ways that can be templated, e.g. a set of plots for website measurements, repeated for each website

We need to think of how this would work for batch mode though. There are a number of possibilities I can think of:

  1. Do nothing and require each website page to have its own set of plotdefs with the website hardcoded
  2. Extend the plotdef model to provide a list of values that should be iterated over when producing plots. We could add a "variants" list, each variant would have a name (which is appended to the generated plot filename) and a set of template variables that sould be used for that variant (the website url for example). The main problem here is that I changed the templating to occur after the plotdef is read but before it is parsed. We would have to switch it back so that we could parse the plotdef, read the variants, iterate over them and inject the variables into the template for each iteration.
  3. Do something similar to 2 but create a separate configuration that defines the variants. We could call these "processing profiles" and each plotdef could have a field that defines which profile it belongs to.
  4. Same as 3 but we don't change the plotdef. Instead we define everything in the config file. We have "processing profiles" that define a list of plotdefs and a list of different sets of variables. Ashby would then perform each profile in turn, iterating over each set of variables and applying them to each plotdef in the profile. So for websites you would have a list of plotdefs that are needed by each website page and a list of different website urls that should be applied to each plotdef. This changes ashby's batch mode from simply iterating through a directory of plotdefs to iterating through a list of profiles, but the templating remains as it is: performed just after the plotdef is read. Would we need to define a profile for all the single-use plotdefs though?

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.