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

JSON Experimental data collection #187

Open
jmafoster1 opened this issue May 17, 2023 · 2 comments
Open

JSON Experimental data collection #187

jmafoster1 opened this issue May 17, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request json frontend

Comments

@jmafoster1
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently, the JSON frontend requires that we specify the path of a CSV file containing the test data. It would be good if we could instead supply a data collection script which would interface directly with the system under test to collect data. A basic solution would be to simply pass in a dataframe object directly rather than the string filename. Then we could have a preprocessing script to execute before the tests to build the dataframe. If anyone has any better ideas, I'm open to suggestions.

@jmafoster1 jmafoster1 added the enhancement New feature or request label May 17, 2023
@jmafoster1 jmafoster1 self-assigned this May 17, 2023
@christopher-wild
Copy link
Contributor

Makes sense, would be nice to be able to directly send it data objects rather than just paths.

I would love to be able to keep the ability of giving it a path to a directory of .csvs. As .csv is such a common file format and it may be the most user friendly way of interacting.

One potential way, which you could argue is 'pythonic', is to do some sort of EAFP (Easier to Ask for Forgiveness than Permission) style argument when giving data to the JSON class.

I.e. we attempt to handle the argument as a Dataframe, and if that throws a type error, handle it and try treat it as a path. If that then fails, throw an exception.

This would allow one argument to handle both Dataframes and paths? Not sure exactly where this sits in good practice though, despite sounding pythonic.

@jmafoster1
Copy link
Contributor Author

I found a temporary workaround for now which is to remove the requirement for a path to be specified. You can then just run your system and do json_class.data = my_data_frame. Not sure how pythonic or best practice this is, but it seems to work. We could easily stick in a validation to make sure the data has been set before any tests are executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request json frontend
Projects
None yet
Development

No branches or pull requests

2 participants