-
Notifications
You must be signed in to change notification settings - Fork 3
Add form-csv to yaml converter #140
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Timestamp,Submitter Name,Submitter Email,Short name of Suite / Problem / Generator,Type,Types of input variables,Number of Input variables (number or range or 'scalable'),Number of Objectives (number or range or 'scalable'),Problem Characteristics [Constrained],Problem Characteristics [Dynamic],Problem Characteristics [Noisy],Problem Characteristics [Multi-modal],Problem Characteristics [Partial evaluations possible],Problem Characteristics [Multiple fidelities],Problem Source,Link to Implementation,Short description of problem(s),Do you wish to provide some more detailed information about the proposed problems?,Full name of suite,Constraint Properties,Number of constraints,Type of Dynamicism,Form of noise model,Type of noise space,Other noise properties,Description of multimodality,Citation / reference,Key challenges / characteristics,Scientific motivation for the proposed suite / problem / generator,Limitations of the proposed suite / problem / generator,Implemenation languages,Links to implementations,Approximate time to evaluate a single solution (or times if e.g. multi-fidelity),Links to examples of usage of the proposed suite / problem / generator,Other relevant information,Feedback about the form | ||
| 16/10/2025 11:17:36,,,test,Single Problem,Continuous,1,1,Multi-modal,,,,,,Real-World Application,test,test,Yes (go to detailed information),,,,,,,,,,,,,,,,,, | ||
| 26/11/2025 12:05:57,Anonymized,Anonymized,MECHBench,Problem Suite,Continuous,scalable',1,Present,Not Present,Not Present,Present,Not Present,Not Present,Real-World Application,https://github.com/BayesOptApp/MECHBench,"This is a set of problems with inspiration from Structural Mechanics Design Optimization. The suite comprises three physical models, from which the user may define different kind of problems which impact the final design output.",Yes (go to detailed information),MECHBench,Hard Constraints,1 or 2,None,None,None,None,Unstructured or non isotropic multimodality,https://arxiv.org/abs/2511.10821,Embeds physical simulations and is flexible and modular,Bridge the black-box optimization techniques to a Mechanical Design Problem which require these kinds of algorithms,"The models do not include fracture or damage mechanics, just plasticity.",Python,https://github.com/BayesOptApp/MECHBench,Times -> from 1 minute to 7 minutes,,, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import pandas as pd | ||
| import yaml | ||
|
|
||
| csv_file = "OPL_form.csv" | ||
| yaml_file = "problems.yaml" | ||
|
|
||
|
|
||
| translations = { | ||
| # "Timestamp", | ||
| # "Submitter Name", | ||
| # "Submitter Email", | ||
| "Short name of Suite / Problem / Generator" : "name", | ||
| "Type" : "suite/generator/single", | ||
| "Types of input variables" : "variable type", | ||
| "Number of Input variables (number or range or 'scalable')" : "dimensionality", | ||
| "Number of Objectives (number or range or 'scalable')" : "objectives", | ||
| "Problem Characteristics [Constrained]":"constraints", | ||
| "Problem Characteristics [Dynamic]":"dynamic", | ||
| "Problem Characteristics [Noisy]":"noise", | ||
| "Problem Characteristics [Multi-modal]":"multimodal", | ||
| "Problem Characteristics [Multiple fidelities]":"multi-fidelity", | ||
| "Problem Source":"source (real-world/artificial)", | ||
| "Link to Implementation" :"implementation", | ||
| "Short description of problem(s)":"textual description", | ||
| "Citation / reference": "reference", | ||
| } | ||
|
|
||
| translations_other = { | ||
| "Short name of Suite / Problem / Generator" : "name", | ||
| "Other relevant information": "general", | ||
| "Problem Characteristics [Partial evaluations possible]" :"partial evaluations", | ||
| "Full name of suite" : "full name", | ||
| "Constraint Properties" : "constraint properties", | ||
| "Number of constraints" : "number of constraints", | ||
| "Type of Dynamicism" : "type of dynamicism", | ||
| "Form of noise model" : "form of noise model", | ||
| "Type of noise space" : "type of noise space", | ||
| "Other noise properties" : "other noise properties", | ||
| "Description of multimodality" : "description of multimodality", | ||
| "Key challenges / characteristics" : "key challenges / characteristics", | ||
| "Scientific motivation for the proposed suite / problem / generator" : "scientific motivation", | ||
| "Limitations of the proposed suite / problem / generator" : "limitations", | ||
| "Implemenation languages" : "implementation languages", | ||
| "Links to implementations" : "links to implementations", | ||
| "Approximate time to evaluate a single solution (or times if e.g. multi-fidelity)" : "approximate evaluation time", | ||
| "Links to examples of usage of the proposed suite / problem / generator" : "links to usage examples", | ||
| } | ||
|
|
||
| # Read the csv file | ||
| data = pd.read_csv(csv_file) | ||
|
|
||
| # Handle empty cells being read as 'NaN', by emptying them again | ||
| data = data.fillna("") | ||
| data_main = data.rename(columns=translations) | ||
| data_main.drop(columns=[col for col in data_main.columns if col not in translations.values()], inplace=True) | ||
| data_main = data_main[data_main['name'] != 'test'] | ||
| data_other = data.rename(columns=translations_other) | ||
| data_other.drop(columns=[col for col in data_other.columns if col not in translations_other.values()], inplace=True) | ||
| data_other = data_other[data_other['name'] != 'test'] | ||
|
|
||
| dict_main = data_main.to_dict(orient="records") | ||
| dict_other = data_other.to_dict(orient="records") | ||
| for dict_m, dict_o in zip(dict_main, dict_other): | ||
| dict_o['name'] = None # Remove duplicate name entry | ||
| dict_m['other info'] = dict_o | ||
|
|
||
| # Write the yaml file | ||
| with open(yaml_file, "a") as out_file: | ||
| yaml.dump(dict_main, out_file, | ||
| sort_keys=False) # Prevent columns being reordered alphabetically | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -900,3 +900,41 @@ | |
| implementation: https://zenodo.org/records/8307853 | ||
| source (real-world/artificial): 'real-world' | ||
| textual description: '' | ||
| - name: MECHBench | ||
| suite/generator/single: Problem Suite | ||
| variable type: Continuous | ||
| dimensionality: scalable' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where does the trailing quote come from? Not sure if it causes problems (I suppose not?), but may be good to check + why it happens.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to be happening when responses are moved from google's form to sheets (which is how I get the csv). I'm not sure if that behavior is changeable, should I instead just remove all quotes from text to be safe?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be best to leave it alone (if there are no issues with the yaml). There could be legitimate reasons for quotes to be entered, maybe? Anyway, probably best to be cautious about removing things. |
||
| objectives: 1 | ||
| constraints: Present | ||
| dynamic: Not Present | ||
| noise: Not Present | ||
| multimodal: Present | ||
| multi-fidelity: Not Present | ||
| source (real-world/artificial): Real-World Application | ||
| implementation: https://github.com/BayesOptApp/MECHBench | ||
| textual description: This is a set of problems with inspiration from Structural | ||
| Mechanics Design Optimization. The suite comprises three physical models, from | ||
| which the user may define different kind of problems which impact the final design | ||
| output. | ||
| reference: https://arxiv.org/abs/2511.10821 | ||
| other info: | ||
| name: null | ||
| partial evaluations: Not Present | ||
| full name: MECHBench | ||
| constraint properties: Hard Constraints | ||
| number of constraints: 1 or 2 | ||
| type of dynamicism: '' | ||
| form of noise model: '' | ||
| type of noise space: '' | ||
| other noise properties: '' | ||
| description of multimodality: Unstructured or non isotropic multimodality | ||
| key challenges / characteristics: Embeds physical simulations and is flexible | ||
| and modular | ||
| scientific motivation: Bridge the black-box optimization techniques to a Mechanical | ||
| Design Problem which require these kinds of algorithms | ||
| limitations: The models do not include fracture or damage mechanics, just plasticity. | ||
| implementation languages: Python | ||
| links to implementations: https://github.com/BayesOptApp/MECHBench | ||
| approximate evaluation time: Times -> from 1 minute to 7 minutes | ||
| links to usage examples: '' | ||
| general: '' | ||
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.
Could you add this file to the repository as example?
(Please make sure to first anonymise submitter name+email and any other possible personal details.)