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

Latest from Osb2 branch to gha test branch #331

Merged
merged 28 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
89f0c41
added ipysheet in reqs to ensure compatibility with ipywidgets, updat…
anhknguyen96 Sep 6, 2022
dee3dc4
Merge pull request #313 from anhknguyen96/development
filippomc Sep 7, 2022
e189ef0
#294 test fix
filippomc Dec 23, 2022
b0f9fc4
Merge branch 'development' of github.com:MetaCell/nwb-explorer into osb2
filippomc Mar 29, 2023
e42a6a3
General libraries update
filippomc Mar 30, 2023
d3a1760
General libraries update
filippomc Mar 30, 2023
4457992
Application update WIP: almost there
filippomc Apr 3, 2023
80b2b0b
#304 npm install fix
filippomc Jun 16, 2023
1779a54
Fix linting and install
filippomc Jun 16, 2023
1d3e2f7
#703 fix langing page style
Jun 24, 2023
1136de4
fix style for container and icon
Jun 28, 2023
30fe010
view sindow icon + fix style for table controlers
Jul 4, 2023
1059141
Fix notebook and more
filippomc Jul 5, 2023
c9b4012
Fix docker build
filippomc Jul 5, 2023
461758a
new yarn lock
filippomc Jul 6, 2023
9c4a64f
Merge branch 'master' of github.com:MetaCell/nwb-explorer into osb2
filippomc Jul 7, 2023
fd1d8d2
Update pynwb
filippomc Jul 7, 2023
2662723
Update nwbwidgets
filippomc Jul 7, 2023
d4ef58b
fix search input border
Salam-Dalloul Jul 12, 2023
40f44db
fix a link style
Salam-Dalloul Jul 12, 2023
de80071
Merge branch 'feature/703' of github.com:MetaCell/nwb-explorer into osb2
filippomc Oct 26, 2023
0a88c87
Updates and build fixes
filippomc Oct 26, 2023
8a3d428
Add pip upgrade to dockerfile
filippomc Oct 31, 2023
f06aaab
Fix plot display
filippomc Nov 10, 2023
07bfdb9
Fix home back error
filippomc Nov 14, 2023
1018c5c
fix model load from event
filippomc Nov 14, 2023
a5b69b0
Fix model switching
filippomc Nov 14, 2023
1af30e9
Splash animation fix
filippomc Nov 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ tox.ini
/src
geppetto-client
.git
**/__pycache__
**/__pycache__
*.log
workspace
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ geppetto-client
/nwb-explorer
pyvenv.cfg
.jupyter-config
/build
33 changes: 19 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
FROM node:13.14 as jsbuild
FROM node:16 as jsbuild

ENV FOLDER=nwb-explorer


WORKDIR $FOLDER/webapp
COPY webapp/package-lock.json .
COPY webapp/yarn.lock .
COPY webapp/package.json .
RUN npm ci
RUN yarn install --network-timeout 1000000000
COPY webapp/ .
RUN npm run build
RUN yarn build
#Remove node_modules, need to keep the geppetto client
RUN mv node_modules/@geppettoengine .
RUN rm -Rf node_modules/*
RUN mv @geppettoengine node_modules
RUN rm -Rf node_modules

###
FROM jupyter/base-notebook:hub-1.1.0
FROM jupyter/base-notebook:hub-1.5.0
ENV NB_UID=jovyan
ENV FOLDER=nwb-explorer
USER root
Expand All @@ -24,29 +22,36 @@ RUN apt-get update -qq &&\
apt-get install python3-tk vim nano unzip git g++ -qq

COPY --chown=1000:1000 requirements.txt .
RUN pip install -r requirements.txt --no-cache-dir
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
pip install -r requirements.txt
USER $NB_UID
COPY . $FOLDER

COPY --chown=$NB_UID:$NB_UID . $FOLDER
COPY --from=jsbuild --chown=1000:1000 $FOLDER $FOLDER

WORKDIR $FOLDER

RUN mkdir workspace



# Temporary fix for deprecated api usage on some requirement
# RUN pip install setuptools==45

USER root
RUN python utilities/install.py --npm-skip

RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
python utilities/install.py --npm-skip


RUN rm -rf /var/lib/apt/lists
# sym link workspace pvc to $FOLDER
RUN mkdir -p /opt/workspace
RUN mkdir -p /opt/home
RUN chown -R $NB_UID .
RUN chown -R $NB_UID /opt/*
# clean workspace from tests
RUN rm -Rf workspace/*
RUN chown $NB_UID app.log
RUN chown $NB_UID /opt/workspace
RUN chown $NB_UID /opt/home
RUN ln -s /opt/workspace ./workspace
RUN ln -s /opt/home ./workspace

Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Learn more about the [Neurodata Without Borders](https://www.nwb.org/).
## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing
purposes. See deployment for notes on how to deploy the project on a live system.
purposes. See deployment for notes on how to deploy the project on a live system.

Alternatively, to see a working demo of nwb explorer without a local setup see the [Open source brain website](http://nwbexplorer.opensourcebrain.org/).

### Prerequisites

Expand All @@ -36,7 +38,7 @@ source nwb-explorer/bin/activate
Or, with conda

```bash
conda create -n nwb-explorer python=3.7
conda create -n nwb-explorer python=3.9
conda activate nwb-explorer
```

Expand All @@ -53,10 +55,11 @@ git clone -b development https://github.com/MetaCell/nwb-explorer
If you have Docker installed, you can run NWB explorer with one single command:

```bash
docker run -it -p8888:8888 gcr.io/metacellllc/nwb-explorer:0.6.2
docker run -it -p8888:8888 gcr.io/metacellllc/nwb-explorer:0.6.2-RC
```

#### Build Docker image

There is a [Dockerfile](./Dockerfile) ready to build a container for NWB-Explorer:

```bash
Expand Down Expand Up @@ -99,7 +102,7 @@ For further information about the Python API, see the [PyNWB docs](https://pynwb

### Python code from sources

In order to have all the Python files NWB:N 2 ed from sources, the application and the dependencies must be installed in development mode, i.e. with the command
In order to have all the Python files NWB:N 2 loaded from sources, the application and the dependencies must be installed in development mode, i.e. with the command

```bash
pip install -e .
Expand All @@ -123,7 +126,6 @@ To check if a dependency is installed in development mode, run `pip list`.
* [PyNWB](https://github.com/NeurodataWithoutBorders/pynwb) - Used to read and manipulate NWB:N 2 files
* [Jupyter notebook](https://jupyter.org/) - Jupyter notebook is used as a backend.


## Background

The NWB Explorer was initially created by [MetaCell](http://metacell.us) to showcase the features of the [Geppetto](http://www.geppetto.org/) platform to share
Expand All @@ -141,5 +143,4 @@ This work is currently funded by the [Wellcome Trust](https://wellcome.ac.uk/).
* Afonso Pinto ([MetaCell](http://metacell.us))
* Padraig Gleeson ([UCL/Open Source Brain](http://opensourcebrain.org))


See also the list of [contributors](https://github.com/Metacell/nwb-explorer/contributors) who participated in this project.
12 changes: 12 additions & 0 deletions node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nwb-extensions/silverlab/silverlab.namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespaces:
- namespace: core
neurodata_types:
- LabMetaData
- NWBData
- source: silverlab.ophys.yaml
- source: silverlab.metadata.yaml
version: '0.2'
2 changes: 2 additions & 0 deletions nwb_explorer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def init_extensions():
try:
with open(init_file) as f:
for line in f:
logging.info("evaluating `%s`", line)
eval(line)
except Exception as e:
logging.error("Error evaluating extension init file " + init_file, exc_info=True)

init_extensions()
73 changes: 63 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,65 @@
airspeed==0.5.20
attrs==19.3.0
cachetools==0.8.0
cffi==1.14.0
cryptography==2.9.2
cycler==0.10.0
decorator==4.4.2
defusedxml==0.6.0
Deprecated==1.2.10
entrypoints==0.3
h5py==3.7.0
idna==2.9
ipython-genutils==0.2.0
imageio==2.5.0
jupyter_geppetto==1.1.1
nwbwidgets==0.8.0
pyecore==0.11.6
pygeppetto==0.8.0
pynwb==2.0.0
Pillow==7.1.2
ipysheet>=0.5.0
jedi==0.17.0
Jinja2==2.11.2
jsonschema==3.2.0
jupyter_geppetto==1.1.5
jupyter-client==7.0.6
jupyter-core==4.9.1
jupyter-server==1.11.2
jupyterhub==1.5.0
jupyterlab==3.2.4
jupyterthemes==0.20.0
kiwisolver==1.2.0
mistune==0.8.4
multimethod==1.3
nbconvert==5.6.1
nbformat==5.0.6
ordered-set==4.0.2
pandocfilters==1.4.2
parso==0.7.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow>=7.2.0
prompt-toolkit==3.0.5
ptyprocess==0.6.0
pycparser==2.20
pyecore==0.11.7
pygeppetto==0.8.1
Pygments==2.6.1
pyparsing==2.4.7
pyrsistent==0.16.0
python-dateutil==2.8.1
python-json-logger==0.1.11
pytz==2020.1
PyYAML==5.3.1
pyzmq==19.0.1
qtconsole==4.7.5
QtPy==1.9.0
quantities==0.12.3
nose==1.3.7
redis==2.10.6
seaborn==0.8.1
uuid==1.30
RestrictedPython==5.0
Send2Trash==1.5.0
terminado==0.8.3
tornado==6.1.0
traitlets==4.3.3
urllib3==1.25.9
webencodings==0.5.1
wrapt==1.12.1
zipp==3.1.0
jupyter_geppetto==1.1.5
nwbwidgets==0.11.3
pygeppetto==0.8.1
pynwb==2.5.0
2 changes: 1 addition & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
sys.argv.append('--NotebookApp.default_url=/geppetto')
sys.argv.append("--NotebookApp.token=''")
sys.argv.append('--library=nwb_explorer')

app = NotebookApp.instance()
app.initialize(sys.argv)
app.file_to_run = ''
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,18 @@
'jupyter_geppetto>=1.1.0',
'bokeh>=0.13.0',
'holoviews>=1.10.6',
'jupyter-core<5',
'jupyter-client<8',
'jupyter-server<2',
'msgpack-python==0.5.6',
'nose>=1.3.7',
'Pillow>=7.0.0',
'redis>=2.10.6',
'seaborn>=0.8.1',
'uuid>=1.30',
'pynwb>=2.0.0',
'pynwb>=2.3.0',
'imageio>=2.5.0',
'quantities>=0.12.3',
'nwbwidgets>=0.8.0'
'nwbwidgets>=0.10.0',
],
)
8 changes: 4 additions & 4 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def create_nwb_file():
interface = mod.add(pynwb.TimeSeries(name='t3', data=data, unit='pA', timestamps=timestamps))
mod.add(pynwb.TimeSeries(name='t4', data=data, unit='UA', timestamps=timestamps))

nwbfile.add_acquisition(create_image('internal_storaged_image', nwbfile, False))
nwbfile.add_acquisition(create_image('external_storaged_image', nwbfile, True))
nwbfile.add_acquisition(create_image('internal_storaged_image', False))
nwbfile.add_acquisition(create_image('external_storaged_image', True))

return nwbfile

def create_image(name, nwbfile, external_storage):
def create_image(name, external_storage):
import imageio
formats = ['png', 'jpg', 'tiff']

Expand All @@ -78,7 +78,7 @@ def create_image(name, nwbfile, external_storage):
return ImageSeries(name=name,
external_file=images_uri,
timestamps=timestamps,
starting_frame=[0],
starting_frame=[0, 0, 0],
format='external',
description='Series of images from a simulation of the cerebellum via neuroConstruct')
else:
Expand Down
2 changes: 1 addition & 1 deletion utilities/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -3240,7 +3240,7 @@ div#notebook {
#header-container {
display: none !important;
}

<script>
MathJax.Hub.Config({
"HTML-CSS": {
Expand Down
11 changes: 7 additions & 4 deletions utilities/embed/embed_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
<title>NWB explorer embedding example</title>
<script>

function updateFile(){
function updateFile(fileName){
console.log("Update called");
let frame = document.getElementById("nwb-explorer");
let fileName = "https://github.com/OpenSourceBrain/NWBShowcase/raw/master/NWB/time_series_data.nwb";
frame.contentWindow.postMessage(fileName, '*');
frame.contentWindow.postMessage({ type: 'LOAD_RESOURCE', payload: fileName }, '*');
}


</script>
</head>

<body>
<iframe id="nwb-explorer" src="http://localhost:8888/geppetto" style="width:100%; min-height: 800px" onLoad="updateFile();"></iframe>
<button onclick="updateFile('https://github.com/OpenSourceBrain/NWBShowcase/raw/master/FergusonEtAl2015/FergusonEtAl2015.nwb');">Load NWB file</button>
<iframe id="nwb-explorer" src="http://localhost:8081/geppetto" style="width:100%; height: 100vh" onLoad="updateFile('https://github.com/OpenSourceBrain/NWBShowcase/raw/master/NWB/time_series_data.nwb');"></iframe>

</body>
</html>
6 changes: 3 additions & 3 deletions utilities/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def main(branch=branch, skipNpm=False, skipTest=False, development=False):

cprint("Installing notebook theme")
# Generate a default config if not already present
execute(cmd=['jupyter', 'notebook', '--generate-config'])
execute(cmd=['jupyter', 'notebook', '--generate-config', '-y'])
from jupyter_core import paths
config_dir = paths.jupyter_config_dir()
print('Jupyter configuration dir is {}'.format(config_dir))
Expand All @@ -137,8 +137,8 @@ def main(branch=branch, skipNpm=False, skipTest=False, development=False):

cprint("Installing client packages")
if not skipNpm:
execute(cmd=['npm', 'install' if development else 'ci'], cwd=WEBAPP_DIR)
execute(cmd=['npm', 'run', 'build-dev' if development else 'build'], cwd=WEBAPP_DIR)
execute(cmd=['yarn', 'install'], cwd=WEBAPP_DIR)
execute(cmd=['yarn', 'build-dev' if development else 'build'], cwd=WEBAPP_DIR)


def steps():
Expand Down
Loading
Loading