-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
meta-modules in node #203
meta-modules in node #203
Conversation
Signed-off-by: tech4GT <[email protected]>
@jywarren also a perk to having a file to store these modules is that if one user wishes to save or his/her configuration( like we do with IDEs like webstorm and VSCode ) they can simply share this file. For eg VScode handles configuration using a config.json file as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok! Left a comment, also how do we specify preset settings for each module?
Thanks!!! Exciting!
{ | ||
"name": "example", | ||
"description": "An example meta module", | ||
"steps":[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So while this is cool, I wonder if we can specify meta modules in a serialized string that is readable as part of a url request. Maybe we need both options so like this OR ?steps=invert[settings...],green-channel, threshold [50]
just for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jywarren you are talking about the browser, right? Actually we have a separate issue to do this for the browser and it's a part of summer proposal as well, if you say i can start working on this right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jywarren this also looks doable, as part of summer project we will be having support for saving a sequence with settings in the url itself and as far as connecting it with this we can have a method that outputs the readable part of the url from the meta-module
function genarateURL(module){
/* generate a string based on default values and sequence of steps8?
return the string
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the ability to record both steps and settings in a string could be useful for browser work, for saving sequences in localStorage
, in a key/value database on server or client side, and for REST based processing, so I think it's worth considering for all those reasons.
Great, though -- so for this PR, so as not to create an incompatibility, we should either think about a subset of the full syntax that will remain compatible after the settings-in-a-string feature, so while here we might just enable settings steps in JSON, we should expect to be able to detect a string submission and switch into a different parsing mode which can read in the settings. I think that means we are OK here - but maybe we should leave an inline comment saying we'll soon accept compact string format like ?steps=invert(settings...),green-channel,threshold(50)
Perhaps using parentheses will make it more like a function call... but we don't have to make a final decision just yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #127 for current planning on compact settings options in URLs
@jywarren presets are given just as we give for a sequence of steps since all this is doing is making an alias for a sequence. |
@jywarren I was thinking maybe we can have an option to store default value of options in the json itself and if the user does not give any values when the module is used it can be used as sort of a fallback case or default values for the meta-module, what say? |
^ great idea -- adding to #127!! |
Looking great; let's add an inline comment referencing string-based steps and how we'll parse them in #127, and move forward! |
Also lets' implement a meta-module in a follow-up PR so that we can link to that commit as an example in the README, showing how simple it is! |
@jywarren this sounds great, I'll add the comment, I had some questions though
|
It's one possible place where sequences could be stored as a string. I'm trying to think about how we make different solutions easy once we standardize a way to store sequences as a string.
I think i'm really thinking of a way to do something like
that is interesting... i think meta-module should probably have some way that options for the meta-module are passed into the sub-modules. I don't know how that should work, but it should be possible to create a metamodule with preset default options, too. Does that make sense? Say, a metamodule with 3 steps, and the second step's options should be fixed, but we should still accept options for the first and third?
How about at line 5 of |
Sorry this took me a while!!! |
@jywarren no prob, working on this now I'll try to come up with a meta module checklist in this issue itself so we can build up from here✌️ |
@jywarren should I put these in an improvements for summer issue ? since this overlaps with some stuff there, I was planning on making issue as well as you suggested |
Yes, i think most of this could be done in follow-up, and we could start with the most basic meta-module implementation and create a checklist for what to do after merging this. How does that sound? |
That sounds great 😁 |
🚀
…On Mon, Apr 16, 2018 at 4:59 PM, Varun Gupta ***@***.***> wrote:
That sounds great 😁
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#203 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ0Am1-of0EVWkmZrrFIofJmXoG8fks5tpRRKgaJpZM4SqfkL>
.
|
@jywarren actually i cannot comment on the .json file😅 |
Let's just open up a new issue exactly describing this needed upgrade, or clean up the one where we spec out the string-based system. OK? |
Awesome, I replied over there. Do you want to merge this in, or tackle more of the system first? |
@jywarren We should wait on this one I guess, I want to work on this a little more before merging this is. Thanks :) |
closing this in favor of #308 |
@jywarren The approach i have taken for this one is having a meta-modules.json file and when user gives the input the meta-modules are expanded in program.step without destroying any ordering then normal operation occurs
I have defined one named
example
which equalsgreen-channel invert
Let's say program.step initially has value [
brightness
,example
,blur
] then expandMetaModules is called, then program.step will become [brightness
,green-channel
,invert
,blur
]Is this a good enough approach for this?, please review
Signed-off-by: tech4GT [email protected]