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

Split config file into advanced and basic setting #542

Closed
derollins opened this issue Apr 27, 2023 · 3 comments
Closed

Split config file into advanced and basic setting #542

derollins opened this issue Apr 27, 2023 · 3 comments
Labels
enhancement New feature or request user experience

Comments

@derollins
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Aid usability by splitting 'basic' functional settings and 'advanced' parameters.

Describe the solution you'd like

Here is my idea:

#Basic

base_dir: C:\Users\Work\OneDrive\Documents\Uni\Research\Data\My_Data\20230426_Sixfold
output_dir: C:\Users\Work\OneDrive\Documents\Uni\Research\Data\My_Data\20230426_Sixfold\output

file_ext: .spm
loading:
  channel: Height
filter:
  run: true
grains:
  run: true
grainstats:
  run: true

plotting:
  run: true
  save_format: png
  image_set: core
  zrange:
  - -4
  - 4
  colorbar: true
  axes: true
  cmap: nanoscope
summary_stats:
  run: true

---------------------------------------------------------------------------------------------------

#Advanced 

log_level: info
cores: 3
filter:
  row_alignment_quantile: 0.2
  threshold_method: std_dev
  otsu_threshold_multiplier: 1.0
  threshold_std_dev:
    below: 10.0
    above: 1.0
  threshold_absolute:
    below: -1.0
    above: 1.0
  gaussian_size: 1.0121397464510862
  gaussian_mode: nearest
  remove_scars:
    run: true
    removal_iterations: 2
    threshold_low: 0.25
    threshold_high: 0.666
    max_scar_width: 4
    min_scar_length: 16
grains:
  threshold_method: std_dev
  otsu_threshold_multiplier: 1.0
  threshold_std_dev:
    below: 10.0
    above: 1.0
  threshold_absolute:
    below: -1.0
    above: 1.0
  direction: above
  smallest_grain_size_nm2: 50
  absolute_area_threshold:
    above:
    - 300
    - 3000
    below:
    - 
    - 
grainstats:
  edge_detection_method: binary_erosion
  cropped_size: 40.0
dnatracing:
  run: true
plotting:
  mask_cmap: blu
  histogram_log_axis: false
  histogram_bins: 200
  dpi: 1000
summary_stats:
  config:

Additional context
Discussed at Pyne group meeting 27/04/2023

@derollins derollins added enhancement New feature or request user experience labels Apr 27, 2023
@ns-rse
Copy link
Collaborator

ns-rse commented Apr 27, 2023

You can't structure a YAML file in that manner as it introduces duplicate key names, e.g. there are now two filter sections. Its why the configuration options that pertain to a step in processing are nested under that processes section.

@SylviaWhittle
Copy link
Collaborator

We could structure it as...

basic:
  base_dir: C:\Users\Work\OneDrive\Documents\Uni\Research\Data\My_Data\20230426_Sixfold
  output_dir: C:\Users\Work\OneDrive\Documents\Uni\Research\Data\My_Data\20230426_Sixfold\output
  file_ext: .spm
  loading:
    channel: Height
  filter:
    run: true
  grains:
    run: true
  grainstats:
    run: true
  
  plotting:
    run: true
    save_format: png
    image_set: core
    zrange:
    - -4
    - 4
    colorbar: true
    axes: true
    cmap: nanoscope
  summary_stats:
    run: true

---------------------------------------------------------------------------------------------------

advanced:  
  log_level: info
  cores: 3
  filter:
    row_alignment_quantile: 0.2
    threshold_method: std_dev
    otsu_threshold_multiplier: 1.0
    threshold_std_dev:
      below: 10.0
      above: 1.0
    threshold_absolute:
      below: -1.0
      above: 1.0
    gaussian_size: 1.0121397464510862
    gaussian_mode: nearest
    remove_scars:
      run: true
      removal_iterations: 2
      threshold_low: 0.25
      threshold_high: 0.666
      max_scar_width: 4
      min_scar_length: 16
  grains:
    threshold_method: std_dev
    otsu_threshold_multiplier: 1.0
    threshold_std_dev:
      below: 10.0
      above: 1.0
    threshold_absolute:
      below: -1.0
      above: 1.0
    direction: above
    smallest_grain_size_nm2: 50
    absolute_area_threshold:
      above:
      - 300
      - 3000
      below:
      - 
      - 
  grainstats:
    edge_detection_method: binary_erosion
    cropped_size: 40.0
  dnatracing:
    run: true
  plotting:
    mask_cmap: blu
    histogram_log_axis: false
    histogram_bins: 200
    dpi: 1000
  summary_stats:
    config:

And then combine all sections together again before config validation? It's a popular feature request by users.

@MaxGamill-Sheffield
Copy link
Collaborator

Fixed in #981

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

No branches or pull requests

4 participants