pymzml / pymzML

pymzML - an interface between Python and mzML Mass spectrometry Files
https://pymzml.readthedocs.io/en/latest/
MIT License
162 stars 92 forks source link

Support for Django (web framework) UploadedFile - optional #164

Closed qdotme closed 4 years ago

qdotme commented 5 years ago

It's a hack - but not a monkey-patch, and could be of use. I'd like to work with you to make it appropriate for inclusion to minimize our burden of maintaining this separate repo.

I've bracketed it in try/except clauses so that it doesn't require Django (and shouldn't break tests) - but otherwise handles uploaded files directly.

Django's UploadedFile is a base class that handles temporary files (which might not be re-openable) and InMemoryUploadedFiles (which don't even have a backing file).

codecov[bot] commented 5 years ago

Codecov Report

Merging #164 into master will decrease coverage by 0.05%. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #164      +/-   ##
==========================================
- Coverage   83.19%   83.13%   -0.06%     
==========================================
  Files          32       32              
  Lines        3505     3517      +12     
==========================================
+ Hits         2916     2924       +8     
- Misses        589      593       +4
Impacted Files Coverage Δ
pymzml/file_interface.py 88.88% <66.66%> (-4.45%) :arrow_down:
pymzml/file_classes/standardMzml.py 59.09% <66.66%> (+0.13%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 726e887...d86ad84. Read the comment docs.

MKoesters commented 5 years ago

Hi Tomasz,

thanks for your contribution! :) I'll have a look at this as fast as I can, but in general, I'm happy to support your idea. We already have some optional dependencies, so in my opionion adding another one shouldn't be a problem. Also, we explicitly enabled pymzML to be extended with different interfaces to various file types, so I'm quite happy that this feature is actually used.

Could you explain a bit more how you would use this features, preferably with a code example?

@fu Whats your opinion on that?

Best, Manuel

fu commented 5 years ago

Hi there,

I like the idea a lot and yes let's have a look into this. Example scripts would definitely help.

Cheers

.c

MKoesters commented 4 years ago

@qdotme could you add an example_script or some additional info to help us understand what you are planning to use that feature for?

Best, Manuel

MKoesters commented 4 years ago

@qdotme are you still interested in this feature? We would need some input from you, if you still wants this to be merged :)