Skip to content

Commit

Permalink
#198 chore: upgrade to latest (master) neuonunit and fix missing obse…
Browse files Browse the repository at this point in the history
…rvation_schema
  • Loading branch information
zsinnema committed May 20, 2021
1 parent e796b09 commit 0c00e91
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ django-db-logger
neo==0.5.2
pynn==0.9.5
Jinja2==2.11.3
git+git://github.com/scidash/neuronunit@metacell
git+git://github.com/scidash/neuronunit@master
git+git://github.com/MetaCell/scidash-api.git@master
wheel
sentry-sdk
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ django-db-logger
neo==0.5.2
pynn==0.9.5
Jinja2==2.11.3
git+git://github.com/scidash/neuronunit@metacell
git+git://github.com/scidash/neuronunit@master
git+git://github.com/MetaCell/scidash-api.git@master
wheel
sentry-sdk
Expand Down
4 changes: 3 additions & 1 deletion scidash/sciunittests/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

# Register your models here.

class ScoreInstanceAdmin(admin.ModelAdmin):
list_display = ('model_instance', 'test_instance', 'status')

class TestClassModelAdmin(admin.ModelAdmin):
search_fields = ['class_name']
Expand Down Expand Up @@ -45,7 +47,7 @@ class TestSuiteAdmin(admin.ModelAdmin):


admin.site.register(TestSuite, TestSuiteAdmin)
admin.site.register(ScoreInstance)
admin.site.register(ScoreInstance, ScoreInstanceAdmin)
admin.site.register(ScoreClass)
admin.site.register(TestInstance, TestInstanceModelAdmin)
admin.site.register(TestClass, TestClassModelAdmin)
18 changes: 12 additions & 6 deletions scidash/sciunittests/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def validate(self, data):
sciunit.settings['PREVALIDATE'] = True
except:
# new style
sciunit.config_set('PREVALIDATE', True)
try:
sciunit.config_set('PREVALIDATE', True)
except:
sciunit.config.set('PREVALIDATE', True)

class_data = data.get('test_class')

Expand Down Expand Up @@ -97,14 +100,17 @@ def filter_units(schema):

return result

if isinstance(test_class.observation_schema, list):
for schema in test_class.observation_schema:
if isinstance(schema, tuple):
observation_schema = test_class.observation_schema
if not observation_schema:
observation_schema = class_data.get("observation_schema")
if isinstance(observation_schema, list):
for schema in observation_schema:
if isinstance(schema, tuple) or len(schema)>1:
without_units += filter_units(schema[1])
else:
without_units += filter_units(schema)
elif test_class.observation_schema:
without_units = filter_units(test_class.observation_schema)
elif observation_schema:
without_units = filter_units(observation_schema)

def process_obs(obs):
try:
Expand Down
2 changes: 0 additions & 2 deletions service/docker/Dockerfile-scidash
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ ARG defaultBranch=development

ENV SERVER_HOME $APP_DIR/virgo-tomcat-server

RUN cat /etc/passwd
RUN useradd -ms /bin/bash developer
ENV HOME /home/developer
RUN cat /etc/passwd

WORKDIR $ROOT

Expand Down
6 changes: 3 additions & 3 deletions service/docker/build_codefresh.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

docker build -f Dockerfile-virgo -t metacell/scidash_virgo:latest .
docker build -f Dockerfile-postgres -t metacell/scidash_db:latest .
docker build -f Dockerfile-scidash -t metacell/scidash:latest .
docker build -f Dockerfile-virgo -t metacell/scidash_virgo:latest ../..
docker build -f Dockerfile-postgres -t metacell/scidash_db:latest ../..
docker build -f Dockerfile-scidash -t metacell/scidash:latest ../..
4 changes: 2 additions & 2 deletions service/docker/build_database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ while true; do
case $yn in
[Yy]* ) read -p "Please type the tag you want to use for this build (default will use the latest and overwrite this). [latest/user_input] > " tag;
if [[ -z "$tag" ]]; then
docker build --build-arg SCIDASH_BRANCH=${branchname} -f Dockerfile-postgres -t metacell/scidash_db:latest .
docker build --build-arg SCIDASH_BRANCH=${branchname} -f Dockerfile-postgres -t metacell/scidash_db:latest ../..
else
docker build --build-arg SCIDASH_BRANCH=${branchname} -f Dockerfile-postgres -t metacell/scidash_db:$tag .
docker build --build-arg SCIDASH_BRANCH=${branchname} -f Dockerfile-postgres -t metacell/scidash_db:$tag ../..
fi
break;;
[Nn]* ) exit;;
Expand Down
4 changes: 2 additions & 2 deletions service/docker/build_scidash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ while true; do
case $yn in
[Yy]* ) read -p "Please type the tag you want to use for this build (default will use the latest and overwrite this). [latest/user_input] >" tag;
if [[ -z "$tag" ]]; then
docker build --no-cache -f Dockerfile-scidash -t metacell/scidash:latest .
docker build --no-cache -f Dockerfile-scidash -t metacell/scidash:latest ../..
else
docker build --no-cache -f Dockerfile-scidash -t metacell/scidash:$tag .
docker build --no-cache -f Dockerfile-scidash -t metacell/scidash:$tag ../..
fi
break;;
[Nn]* ) exit;;
Expand Down
4 changes: 2 additions & 2 deletions service/docker/build_virgo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ while true; do
case $yn in
[Yy]* ) read -p "Please type the tag you want to use for this build (default will use the latest and overwrite this). [default/user_input] > " tag;
if [[ -z "$tag" ]]; then
docker build --no-cache -f Dockerfile-virgo -t metacell/scidash_virgo:latest .
docker build --no-cache -f Dockerfile-virgo -t metacell/scidash_virgo:latest ../..
else
docker build --no-cache -f Dockerfile-virgo -t metacell/scidash_virgo:$tag .
docker build --no-cache -f Dockerfile-virgo -t metacell/scidash_virgo:$tag ../..
fi
break;;
[Nn]* ) exit;;
Expand Down

0 comments on commit 0c00e91

Please sign in to comment.