-
Notifications
You must be signed in to change notification settings - Fork 0
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
sample feature #48
Comments
found this interesting article about workflow patterns: Control-Flow Patterns. The reason why I'm considering this, is because I'm looking at the classes required to implement the sampling feature. So far, I have come up with the followng abstractions (the names are not necessarily the ones that will be used):
Actually, the referenced site looks to be very good as it deals with scenarios that I have been wrestling with in various parts of my snivilised projects, but I have dealt with them on an adhoc manner, coming up with my own way of doing things rather that looking at established patterns. This can serve as a very good reference. A lot of these pattarns are relevant for web workfows, but they can be adapted to be used in other contexts too. |
some temporary code: func (pc ProfilesConfig) AsCommandLine(name string) cobrass.ThirdPartyCommandLine {
const approx = 2
if name != "" {
if profile, found := pc[name]; !found {
keys := profile.Keys()
size := len(keys)
cl := make(cobrass.ThirdPartyCommandLine, 0, size*approx)
for flag, optionValue := range keys {
long := fmt.Sprintf("--%v", flag)
cl = append(cl, long)
if !slices.Contains(booleanValues, optionValue) {
cl = append(cl, optionValue)
}
}
return cl
}
}
return cobrass.ThirdPartyCommandLine{}
}
func (pc ProfilesConfig) WithDashes(name string) clif.SpecifiedFlagsCollection {
if name != "" {
if profile, found := pc[name]; found {
flags := clif.SpecifiedFlagsCollection{}
for _, flag := range profile.Keys() {
optionValue := profile[flag]
long := fmt.Sprintf("--%v", flag)
flags[long] = optionValue
}
return flags
}
}
return clif.SpecifiedFlagsCollection{}
} |
NB: we can open a folder (on mac), (for pixa, typically the output folder) from the command line using:
On windows (yet to be confirmed):
Not sure what the linux equivalent is yet... |
Need to start using mocking, in this case so we can mock out viper config. Using uber mock. The first to know, is how to make a mock; here is the documented example (as described in mock_test.go):
But actually, this doesnt clearly explain how to mock a foreign interface. I found this: codecentric.de gomock-tutorial, which may be a bit clearer, in particular:
where:
To make this a bit easier, we should not try to create a mock for a foreign interface as this is complicating the task. Create the mock in CObrass and then export it so it can be resued by clients. |
Actually, after having implemented a mock for viper config, I realised its better to re-organise the profiles and sampler config. They should be wrapped behind interfaces then mocks should be generated for those. The problem with mocking viper config is that its difficult to re-implement the marshalling when really, we need to by-pass marshalling altogether. |
this feature looks to be too big to do under a single issue; therefore it will be split up. This issue will deal just with the default scenario, which is transparent mode which means:
|
feat(test): move test folder and provide other test setup (#48) feat(proxy): add registry, runner and other supporting functionality (#48) feat(proxy): setup scientist directory for testing (#48) feat(proxy): move program execution to runner (#48) feat(proxy): add profile/scheme validation (#48) feat(proxy): clean up root param set/root inputs (#48) feat(proxy): validate sampler info (#48) feat(proxy): change profile params to be a map for cobrass.ThirdPartyCommandLine (#48) feat(proxy): add initial sequencing functionality (#48) chore(deps): incoming breaking changes from extendio & cobrass (#48) ref(proxy): reorganise runner (#48) test(proxy): migrate tests to use virtual-fs (#48) test(proxy): mock viper config (#48) test(proxy): mock configs (#48) ref(proxy): redesign configs so they can be mocked (#48) test(proxy): mock config readers (#48) ref(proxy): add supporting code for strategies and some tidy up (#48) ref(proxy): rename mirror-path to output (#48) feat(proxy): add trash flag (#48) feat(proxy): add vfs and implement strategies (#48) feat(proxy): add basic path-finder transparent mode (#48) feat(proxy): tidy up (#48)
Allows user to try out multiple profiles in the same batch to see which one works the best. Requires a sample entry in the config which is just an array of string. Each string referrers to a profile
The sample config also needs a number of images to try on (let's default to 3) and a minimum image size in MB (default=1).
For each of the images run the selected profile.
By default, the default directory is the current one. For each file we create a relative path that contains the profile name. The out file name by default s the same as the input file, but this can be changed by a config setting
Actually we can create many more config settings without necessarily creating flags. This will avoid complicating the cli.
Some more design notes:
Further tasks:
The text was updated successfully, but these errors were encountered: