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

SamplesIO target extension -- make extention a part of the writer [annoying, user experience feedback] #503

Closed
3 tasks done
Tracked by #488
nicolay-r opened this issue Jul 22, 2023 · 0 comments
Closed
3 tasks done
Tracked by #488
Assignees
Labels
critical enhancement New feature or request

Comments

@nicolay-r
Copy link
Owner

nicolay-r commented Jul 22, 2023

Problem: switching from one format to the other becomes necessary when the writer has changed.
So output format is supposed to be associated with the writer.

  • Removed target_extension custom parameter (d33aa51)
  • Samples instanciates everywhere with writer. We may consider that user should specify at least one provider.

samples_io=SamplesIO(self.__output_dir, writer, target_extension=".tsv.gz"),

  • make this code a part of the related classes:
    def create_writer_extension(writer):
    assert(isinstance(writer, BaseWriter))
    if isinstance(writer, OpenNREJsonWriter):
    return OPENNRE_EXTENSION
    if isinstance(writer, PandasCsvWriter):
    return PANDAS_CSV_EXTENSION
    if isinstance(writer, NativeCsvWriter):
    return ".csv"
    raise NotImplementedError()

def create_reader_extension(writer):
assert(isinstance(writer, BaseReader))
if isinstance(writer, PandasCsvReader):
return PANDAS_CSV_EXTENSION
if isinstance(writer, OpenNREJsonWriter):
return OPENNRE_EXTENSION
raise NotImplementedError()

@nicolay-r nicolay-r added the enhancement New feature or request label Jul 22, 2023
@nicolay-r nicolay-r self-assigned this Jul 22, 2023
@nicolay-r nicolay-r changed the title SamplesIO -- remove dependency from the output extension [annoying, user experience feedback] SamplesIO target extension -- make extention a part of the writer [annoying, user experience feedback] Jul 22, 2023
@nicolay-r nicolay-r mentioned this issue Jul 22, 2023
24 tasks
nicolay-r added a commit that referenced this issue Sep 14, 2023
nicolay-r added a commit that referenced this issue Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant