Skip to content

Commit

Permalink
Merge pull request #636 from arayabrain/develop-main
Browse files Browse the repository at this point in the history
rm large files from package
  • Loading branch information
ReiHashimoto authored Apr 15, 2024
2 parents 26ef6df + bf06cef commit b2d923c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ include = [
"frontend/build/static/js/*",
"frontend/build/static/media/*",
"studio/app/optinist/core/nwb/nwb.yaml",
"studio/app/optinist/microscopes/libs.zip",
"studio/app/common/core/snakemake/snakemake.yaml",
"studio/app/*/wrappers/**/*.yaml",
"studio/app/Snakefile",
Expand Down
7 changes: 7 additions & 0 deletions studio/app/optinist/microscopes/ND2Reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from enum import Enum, IntEnum

import numpy as np
import requests

from studio.app.dir_path import DIRPATH
from studio.app.optinist.microscopes.MicroscopeDataReaderBase import (
Expand Down Expand Up @@ -64,6 +65,12 @@ class ND2Reader(MicroscopeDataReaderBase):
def unpack_libs():
"""Unpack library files"""
if not os.path.isdir(DIRPATH.MICROSCOPE_LIB_DIR):
if not os.path.exists(DIRPATH.MICROSCOPE_LIB_ZIP):
response = requests.get(
"https://github.com/oist/optinist/raw/v1.2.1/studio/app/optinist/microscopes/libs.zip" # noqa: E501
)
with open(DIRPATH.MICROSCOPE_LIB_ZIP, "wb") as f:
f.write(response.content)
shutil.unpack_archive(
DIRPATH.MICROSCOPE_LIB_ZIP, DIRPATH.MICROSCOPE_LIB_DIR
)
Expand Down
8 changes: 8 additions & 0 deletions studio/app/optinist/microscopes/OIRReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import shutil

import numpy as np
import requests

import studio.app.optinist.microscopes.modules.olympus.lib as lib
from studio.app.dir_path import DIRPATH
Expand Down Expand Up @@ -58,6 +59,13 @@ class OIRReader(MicroscopeDataReaderBase):
def unpack_libs():
"""Unpack library files"""
if not os.path.isdir(DIRPATH.MICROSCOPE_LIB_DIR):
if not os.path.exists(DIRPATH.MICROSCOPE_LIB_ZIP):
response = requests.get(
"https://github.com/oist/optinist/raw/v1.2.1/studio/app/optinist/microscopes/libs.zip" # noqa: E501
)
with open(DIRPATH.MICROSCOPE_LIB_ZIP, "wb") as f:
f.write(response.content)

shutil.unpack_archive(
DIRPATH.MICROSCOPE_LIB_ZIP, DIRPATH.MICROSCOPE_LIB_DIR
)
Expand Down

0 comments on commit b2d923c

Please sign in to comment.