Giter Club home page Giter Club logo

Comments (6)

freider avatar freider commented on August 17, 2024

I don't agree that we should remove them. We use them heavily for some things (switching to test mode for a general base task, changing fair scheduler pools etc.). However I think it makes sense to differentiate the interface for how to declare them vs how to declare "local" parameters (I don't like is_global=True) . Being "global" I think it makes more sense to have something like this in the global scope:

luigi.register_global('pool', IntegerParameter(default=5))

class MyTask(Task):
    def run(self):
         pool = luigi.global('pool')
         ...

This will clean up a lot of the global vs. local parameter code used within tasks and make it clearer what a task parameter and a global is. Not sure about providing the type as a parameter in register_global() above, but I think it can be convenient from a command line parsing perspective.

What do you think?

from luigi.

erikbern avatar erikbern commented on August 17, 2024

I think that makes sense, a lot of the problems are because they are defined in the task scope.

what about

luigi.global.pool = IntegerParameter(default=5)

maybe weird to modify internals like that

from luigi.

JoeEnnever avatar JoeEnnever commented on August 17, 2024

+1 to deprecating. We only use them in a few places that could easily be changed. We tend to use the Luigi configuration for globally scoped configurations.

from luigi.

JonNelson avatar JonNelson commented on August 17, 2024

I have to give -1, at least to both of the suggested replacements as they stand.
I usually do something like this:

some_global_param = luigi.Parameter(..., default=some_default)

class SomeTask(..):
  param = some_global_param
  other_param_here

class SomeOtherTask(..):
  params_here

Registering a global param strikes me as distasteful because it's modifying internal luigi state, and it seems to violate a bit of the sandboxing principle.

Perhaps defining the use-cases might be worthwhile?

from luigi.

ediskandarov avatar ediskandarov commented on August 17, 2024

Can anyone remind me how create global parameter using client.cfg?

from luigi.

Tarrasch avatar Tarrasch commented on August 17, 2024

Parameter system is completely rewritten and there are no globals anymore. Closing this. See docs for usage of the new system.

from luigi.

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.