Skip to content
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

Read initializations from file #5

Open
asmaloney opened this issue Aug 8, 2021 · 0 comments
Open

Read initializations from file #5

asmaloney opened this issue Aug 8, 2021 · 0 comments
Labels
enhancement New feature or request language amod language changes

Comments

@asmaloney
Copy link
Owner

asmaloney commented Aug 8, 2021

If there is a lot of data to initialize, writing it all in the amod file is impractical. So instead of hard-coding specific file formats, provide an API and allow plugins to read the data - possibly with something like go-plugin. If done properly, this would allow writing plugins in almost any language.

Then the init section might look like this:

memory {
    reader: my-csv-plugin
    files {
        'file name 1'
        'file name 2'
    }
}

Where reader might be an external plugin or an internal one (i.e. flat text file).

Currently the python backend has to write these out like this:

	def init():
		memory.add('count 0 1')
		memory.add('count 1 2')
		memory.add('count 2 3')
		memory.add('count 3 4')
		memory.add('count 4 5')
		memory.add('count 5 6')
		memory.add('count 6 7')
		memory.add('count 7 8')

Which is also impractical. So we would have to figure out how to handle this more intelligently.

@asmaloney asmaloney added the enhancement New feature or request label Aug 8, 2021
@asmaloney asmaloney added the language amod language changes label May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request language amod language changes
Projects
None yet
Development

No branches or pull requests

1 participant