Closed eeintech closed 1 year ago
This would be one option, I imagined this like comma separated values in combination with the a-c syntax, so that we can do something like a-f,hello,k-o,world
. What do you think of that?
This would be one option, I imagined this like comma separated values in combination with the a-c syntax, so that we can do something like
a-f,hello,k-o,world
. What do you think of that?
Yup that's a good idea!
Hello @eeintech,
I'm currently implementing this and asking myself, how should this behave if there are "Infinity-generators" being used? I have three options in mind, what do you think would be best?
E.g.: dimensions=a-c,NUMERIC,hello,1-3,world
and count=10
count
elements => a,b,c,1,2,hello,1,2,3,world
However, what should happen if we use two infinity generators?
NUMERIC{count_from=5,step=2}
. Then I could also add an option for count like that: a-c,NUMERIC{count=5},hello,1-3,world
=> a,b,c,1,2,3,4,5,hello,1
.If I would do so next issue would be how to differentiate between words and names of Infinity generators? My idea was to use some kind of unpacking syntax like python with an *
before the infinity generators. a-c,*NUMERIC{count=5},hello,1-3,world
. (Disadvantage: *
cannot be used as first character of a word)
@wolflu05 I would keep it simple and limit options else support and tests will be become very challenging, also for maintenance purposes. IMO it's okay to separate and have to repeat an operation twice, so I would go with this:
dimensions=a-c,hello,1-3,world
=> count
is skippeddimensions=NUMERIC
=> count
is mandatorydimensions=a-c,NUMERIC,hello
(mixing finite and infinite quantities) => NOT allowed@eeintech I planned the inputs from beginning to be able to have adjustable templates which can be reused. E.g. your drawer shelves are available in 15/48/60 drawers per shelve. So you only need one template and you can adjust the number of drawers without looking deeper into the options of the template. But, if your shelves always have at the bottom one big drawer (like one user mentioned on the inventree discussion), you need to mix infinity generators and finite generator patterns. (Currently the input options are not fully integrated into all parameters, but I will do that soon)
What do you think about my proposed configuration syntax for infinity generators? Or should the be more input fields (also means the page is getting bigger and reduces overview) to configure step width, starting position? But then I can't use them in such lists.
To 1 from your reply: Currently the count parameter can already limit finite dimensions.
I'm not sure to grasp what you are saying so I'm not sure what makes more sense. I think you should go with what you have in mind for the moment for the syntax and then see if you run into edge cases than cannot be solved otherwise than changing the syntax.
@eeintech I implemented a much more powerful and extension-able generators setup in #7. Maybe you can give it a look what do you think? I added documentation about this change also to the readme.
Maybe I should do documentation with docusaurus some time to make it more readable.
@wolflu05 Sorry won't have much time to review and comment in the next few weeks, thanks for letting me know though.
This is now implemented. See #7
In addition to ranges and generic names, add single count dimensions with words in them, example: