Skip to content

Commit

Permalink
Release 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lemieuxl committed May 20, 2018
2 parents 5b5e4d0 + 5eda16d commit 5d33be4
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
15 changes: 14 additions & 1 deletion conda_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ do
# Converting to the different platforms
for platform in $platforms
do
conda convert -p $platform $filename -o ../conda_dist
conda convert -p $platform $filename -o ../conda_dist &> build_log.txt

# Checking the conversion was completed
if [ $? -ne 0 ]
Expand All @@ -67,6 +67,19 @@ do
exit 1
fi

# Checking if a conversion was skipped due to same platform
if egrep --quiet Skipping build_log.txt; then
# Finding which platform was skipped
missing=$(
egrep Skipping build_log.txt |
egrep -o "'([[:alnum:]]+-[[:digit:]]+)'" |
uniq |
sed -e "s/'//g"
)
mkdir -p ../conda_dist/$missing
cp $filename ../conda_dist/$missing
fi

done

# Purging
Expand Down
16 changes: 13 additions & 3 deletions genipe/task/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
import os
import re
import sys
import time
import shlex
import logging
import traceback
from os.path import isfile
from datetime import datetime
from multiprocessing import Pool
from subprocess import Popen, PIPE
from tempfile import NamedTemporaryFile
Expand Down Expand Up @@ -602,10 +604,18 @@ def _execute_command_drmaa(command_info):
logging.debug("'{}' exit status problem".format(task_id))
return False, name, "problem", None

# Getting the time
# Getting the launch time (should always been present)
launch_time = float(ret_val.resourceUsage["submission_time"])
start_time = float(ret_val.resourceUsage["start_time"])
end_time = float(ret_val.resourceUsage["end_time"])

# Getting the start time. If 'start_time' is missing from the dictionary
# (e.g. using Slurm), we use the launch time as the start time
start_time = float(ret_val.resourceUsage.get("start_time", launch_time))

# Getting the end time. If 'end_time' is missing from the dictionary
# (e.g. using Slurm), we use the current time as the end time
end_time = float(ret_val.resourceUsage.get(
"end_time", time.mktime(datetime.now().timetuple()),
))

# The task was performed correctly, so we update to completed
db.mark_drmaa_task_completed(task_id, launch_time, start_time, end_time,
Expand Down
6 changes: 4 additions & 2 deletions genipe/tests/test_imputed_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,10 @@ def test_read_samples(self):
# Checking
with self.assertRaises(ValueError) as cm:
imputed_stats.read_samples(sample_filename)
self.assertEqual("Index has duplicate keys: ['sample_2']",
str(cm.exception))
self.assertTrue(str(cm.exception).startswith(
"Index has duplicate keys"
))
self.assertTrue("sample_2" in str(cm.exception))

def test_read_sites_to_extract(self):
"""Tests the 'test_read_sites_to_extract' function."""
Expand Down
4 changes: 3 additions & 1 deletion genipe/tools/imputed_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,9 @@ def _extract_mixedlm_random_effect(fitted):

# If it's a dictionary, we need to create a DataFrame
if isinstance(random_effects, dict):
return pd.DataFrame(random_effects).T.rename(columns={"groups": "RE"})
return pd.DataFrame(random_effects).T.rename(
columns={"groups": "RE", "Group": "RE"},
)

return random_effects.rename(columns={"Intercept": "RE"})

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

MAJOR = 1
MINOR = 4
MICRO = 0
MICRO = 1
VERSION = "{0}.{1}.{2}".format(MAJOR, MINOR, MICRO)


Expand Down

0 comments on commit 5d33be4

Please sign in to comment.