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

Transform air-oed without config file #124

Merged
merged 7 commits into from
Jul 1, 2024
Merged

Transform air-oed without config file #124

merged 7 commits into from
Jul 1, 2024

Conversation

ncerutti
Copy link
Contributor

@ncerutti ncerutti commented Jun 26, 2024

Transform air to oed without config file

A simple transformation from air to oed and vice versa can be run without creating a config file, but simply by command line

It is now possible to run a transformation without using a configuration file. Solves #125.

For example, the command:

ods_tools transform --format air-oed --input-file air_input.csv --output-file oed_output.csv

will produce the oed file output.csv from the air file input.csv
We currently support air-oed and oed-air.

@ncerutti ncerutti self-assigned this Jun 26, 2024
@ncerutti ncerutti added the enhancement New feature or request label Jun 26, 2024
@ncerutti ncerutti linked an issue Jun 26, 2024 that may be closed by this pull request
@ncerutti ncerutti marked this pull request as ready for review June 26, 2024 10:03
@ncerutti ncerutti requested a review from sstruzik June 26, 2024 12:00
"""
transform_command = command_parser.add_parser('transform', description=transform_description,
formatter_class=argparse.RawTextHelpFormatter)
transform_command.add_argument('--config-file', help='Path to the config file', required=True)
transform_command.add_argument('--config-file', help='Path to the config file')
transform_command.add_argument('--oed-air', help='directly transforms OED to AIR format', action='store_true')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think those should be direct argument of the command because you will end up having to add n^2 arguments each time you have a new built-in transformation
I would add a single argument named -f --formats
that tell you which transformation to do
either -f or --config-file needs to be present to do the transformation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks! I changed it to -f/--format.
(in the same spirit, I changed a bit the generate_config() function too, to avoid excessive hardcoding)

@ncerutti ncerutti requested a review from sstruzik June 28, 2024 15:13
@sambles sambles merged commit 31f51ff into main Jul 1, 2024
15 checks passed
@sambles sambles deleted the feature/odtfsimple branch July 1, 2024 12:06
sambles pushed a commit that referenced this pull request Jul 1, 2024
* enable transformation without config file

* fix reverse mappings

* comments

* pep

* format as argument with --format

* adjust logger when failing

* remove oed-air arg
@sambles sambles mentioned this pull request Jul 1, 2024
@awsbuild awsbuild added this to the 3.2.5 milestone Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request LTS - 2.3
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Run transformation without config file
4 participants