-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into qurator-omni
- Loading branch information
Showing
13 changed files
with
280 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"default": true, | ||
"no-blanks-blockquote": false, | ||
"no-duplicate-heading": { | ||
"siblings_only": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# Rudimentary tests | ||
|
||
## TODO | ||
|
||
* [ ] run inside of Docker container that mimics Lambda env | ||
* https://blog.quiltdata.com/an-easier-way-to-build-lambda-deployment-packages-with-docker-instead-of-ec2-9050cd486ba8 | ||
* https://nvbn.github.io/2015/09/09/pytest-docker/ | ||
* <https://blog.quiltdata.com/an-easier-way-to-build-lambda-deployment-packages-with-docker-instead-of-ec2-9050cd486ba8> | ||
* <https://nvbn.github.io/2015/09/09/pytest-docker/> | ||
|
||
* [ ] parameterize Python version (Lambda functions can be 2.7, 3.6, etc.) | ||
* [ ] integrate withe rest of unit testing suite? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<!-- markdownlint-disable first-line-h1 --> | ||
See notebook for original source of files | ||
|
||
normal.fcs was Accuri - C6 - A01 H2O.fcs | ||
meta-only.fcs was BD - FACS Aria II - Compensation Controls_G710 Stained Control.fcs | ||
* normal.fcs was Accuri - C6 - A01 H2O.fcs | ||
* meta-only.fcs was BD - FACS Aria II - Compensation Controls_G710 Stained Control.fcs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,68 @@ | ||
<!-- markdownlint-configure-file {"line-length": {"code_blocks": false}} --> | ||
# Developer notes | ||
|
||
* How we get pdftoppm running with MS fonts | ||
* On MacBook testing: jpeg faster than png, pdftoppm faster than pdftocairo | ||
|
||
## Extracting pdftoppm, pdftocairo (via poppler-utils) as standalones | ||
``` | ||
|
||
```sh | ||
yum install yum-utils rpmdevtools | ||
yumdownloader poppler-utils | ||
yumdownloader poppler-utils | ||
|
||
# Extract files from .rpm | ||
rpmdev-extract *.rpm | ||
``` | ||
|
||
Then you need to run the binaries by hand and discover which .o files are missing. These files | ||
were found to be children of /usr/lib64 and when they are copied to the same, /usr/bin/pdftoppm works. | ||
Then you need to run the binaries by hand and discover which .o files are | ||
missing. These files were found to be children of /usr/lib64 and when they | ||
are copied to the same, /usr/bin/pdftoppm works. | ||
|
||
Consider setting [`LD_LIBRARY_PATH`](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime) | ||
to include /somedir/usr/lib64 so Linux can find the libs. | ||
|
||
|
||
## Getting MS fonts | ||
|
||
* [Installing cabextract on Amazon Linux](https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/) | ||
* [Adding MS fonts to linux](http://mscorefonts2.sourceforge.net/) | ||
|
||
Above step will add fonts to `cp -r /usr/share/fonts` | ||
|
||
## Making the fonts discoverable via pdftoppm, etc. | ||
## Making the fonts discoverable via pdftoppm, etc | ||
|
||
* [fonts.conf](https://stackoverflow.com/questions/46486261/include-custom-fonts-in-aws-lambda) | ||
* `fc-cache` (unix util) | ||
|
||
``` | ||
```sh | ||
export FONTCONFIG_PATH=/io/fonts/ | ||
``` | ||
|
||
## `pdftoppm` | ||
|
||
* Page numbering starts at 1 (not 0) | ||
* Providing size=INT to a convert function ensures largest dimension == INT | ||
* first_page can be negative (lib rounds up to 1) | ||
* last_page can be > than total pages (lib takes min) | ||
|
||
No format (=ppm) faster than JPEG faster than PNG | ||
|
||
``` (=ppm)(=ppm) | ||
In [8]: %timeit imgs = pdf2image.convert_from_path("tests/data/MUMmer.pdf", fmt="png",size=(1024,768)) | ||
```Python console | ||
In [8]: %timeit imgs = pdf2image.convert_from_path("tests/data/MUMmer.pdf", fmt="png",size=(1024,768)) | ||
4.3 s ± 162 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) | ||
|
||
In [9]: %timeit imgs = pdf2image.convert_from_path("tests/data/MUMmer.pdf", fmt="jpeg", size=(1024,768)) | ||
In [9]: %timeit imgs = pdf2image.convert_from_path("tests/data/MUMmer.pdf", fmt="jpeg", size=(1024,768)) | ||
970 ms ± 58.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) | ||
|
||
In [10]: %timeit imgs = pdf2image.convert_from_path("tests/data/MUMmer.pdf", size=(1024,768)) | ||
In [10]: %timeit imgs = pdf2image.convert_from_path("tests/data/MUMmer.pdf", size=(1024,768)) | ||
798 ms ± 37.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) | ||
``` | ||
|
||
jpeg also outputs faster: | ||
``` | ||
In [14]: %timeit imgs[3].save("tmp-1024-768.png") | ||
|
||
```Python console | ||
In [14]: %timeit imgs[3].save("tmp-1024-768.png") | ||
198 ms ± 4.97 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) | ||
|
||
In [15]: %timeit imgs[3].save("tmp-1024-768.jpeg") | ||
In [15]: %timeit imgs[3].save("tmp-1024-768.jpeg") | ||
44.1 ms ± 4.36 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters