fjuniorr / flowmapper

Mappings between elementary flows
MIT License
0 stars 1 forks source link

Keep single `--matched` and `--unmatched` CLI flags #59

Open fjuniorr opened 6 months ago

fjuniorr commented 6 months ago

The current CLI flags are:

Usage: flowmapper map [OPTIONS] SOURCE TARGET

  Generate mappings between elementary flows lists

Arguments:
  SOURCE  Path to source flowlist  [required]
  TARGET  Path to target flowlist  [required]

Options:
  --fields PATH                   Relationship between fields in source and
                                  target flowlists  [required]
  --output-dir PATH               Directory to save mapping and diagnostics
                                  files  [default: .]
  --format [all|glad|randonneur]  Mapping file output format  [default: all]
  --unmatched-source / --no-unmatched-source
                                  Write original source unmatched flows into
                                  separate file?  [default: unmatched-source]
  --unmatched-target / --no-unmatched-target
                                  Write original target unmatched flows into
                                  separate file?  [default: unmatched-target]
  --matched-source / --no-matched-source
                                  Write original source matched flows into
                                  separate file?  [default: no-matched-source]
  --matched-target / --no-matched-target
                                  Write original target matched flows into
                                  separate file?  [default: no-matched-target]

To simplify the options we can merge --matched and --unmatched and export both source and target flows to the same json file. The CLI would be:

Usage: flowmapper map [OPTIONS] SOURCE TARGET

  Generate mappings between elementary flows lists

Arguments:
  SOURCE  Path to source flowlist  [required]
  TARGET  Path to target flowlist  [required]

Options:
  --fields PATH                   Relationship between fields in source and
                                  target flowlists  [required]
  --output-dir PATH               Directory to save mapping and diagnostics
                                  files  [default: .]
  --format [all|glad|randonneur]  Mapping file output format  [default: all]
  --unmatched / --no-unmatched
                                  Write original unmatched flows into
                                  separate file?  [default: unmatched]
  --matched / --no-matched
                                  Write original matched flows into
                                  separate file?  [default: no-matched]

And the json files (one for unmatched and one for matched)

{
    "source": [
        {},
    ],
    "target": [
        {},
    ]
}
cmutel commented 6 months ago

export both source and target flows to the same json file

No sure about this - I think that most of our users would prefer separation. Let's wait until we get more experience using it, and see if people are complaining about this.