Skip to content

Commit

Permalink
Merge pull request #27 from pepkit/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
nsheff committed Mar 20, 2019
2 parents b9083ac + cd43304 commit b1b456f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion divvy/_version.py
@@ -1,2 +1,2 @@
__version__ = "0.2"
__version__ = "0.2.1"

12 changes: 6 additions & 6 deletions divvy/compute.py
Expand Up @@ -6,7 +6,7 @@
from sys import stdout
import yaml

from attmap import AttMap
from attmap import PathExAttMap
from .const import \
COMPUTE_SETTINGS_VARNAME, \
DEFAULT_COMPUTE_RESOURCES_NAME
Expand All @@ -16,7 +16,7 @@
_LOGGER = logging.getLogger(__name__)


class ComputingConfiguration(AttMap):
class ComputingConfiguration(PathExAttMap):
"""
Represents computing configuration objects.
Expand Down Expand Up @@ -147,7 +147,7 @@ def activate_package(self, package_name):
# Augment compute, creating it if needed.
if self.compute is None:
_LOGGER.debug("Creating Project compute")
self.compute = AttMap()
self.compute = PathExAttMap()
_LOGGER.debug("Adding entries for package_name '%s'", package_name)
self.compute.add_entries(self.compute_packages[package_name])

Expand Down Expand Up @@ -186,7 +186,7 @@ def get_active_package(self):
"""
Returns settings for the currently active compute package
:return AttMap: data defining the active compute package
:return PathExAttMap: data defining the active compute package
"""
return self.compute

Expand All @@ -204,7 +204,7 @@ def reset_active_settings(self):
:return bool: success flag
"""
self.compute = AttMap()
self.compute = PathExAttMap()
return True

def update_packages(self, config_file):
Expand Down Expand Up @@ -241,7 +241,7 @@ def update_packages(self, config_file):
loaded_packages[key][key2])

if self.compute_packages is None:
self.compute_packages = AttMap(loaded_packages)
self.compute_packages = PathExAttMap(loaded_packages)
else:
self.compute_packages.add_entries(loaded_packages)
_LOGGER.info("Available packages: {}".format(', '.join(self.list_compute_packages())))
Expand Down
12 changes: 4 additions & 8 deletions divvy/utils.py
Expand Up @@ -351,7 +351,7 @@ def sample_folder(prj, sample):
"""
Get the path to this Project's root folder for the given Sample.
:param AttMap | Project prj: project with which sample is associated
:param PathExAttMap | Project prj: project with which sample is associated
:param Mapping sample: Sample or sample data for which to get root output
folder path.
:return str: this Project's root folder for the given Sample
Expand Down Expand Up @@ -430,18 +430,14 @@ class CommandChecker(object):
"""
Validate PATH availability of executables referenced by a config file.
:param path_conf_file: path to configuration file with
:param str path_conf_file: path to configuration file with
sections detailing executable tools to validate
:type path_conf_file: str
:param sections_to_check: names of
:param Iterable[str] sections_to_check: names of
sections of the given configuration file that are relevant;
optional, will default to all sections if not given, but some
may be excluded via another optional parameter
:type sections_to_check: Iterable[str]
:param sections_to_skip: analogous to
:param Iterable[str] sections_to_skip: analogous to
the check names parameter, but for specific sections to skip.
:type sections_to_skip: Iterable[str]
"""


Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.md
@@ -1,5 +1,10 @@
# Changelog

## divvy [0.2.1] - 2019-03-19

### Changed
- For environment variable population, use updated version of `attmap`

## divvy [0.2] - 2019-03-13

### Added
Expand Down
3 changes: 2 additions & 1 deletion requirements/requirements-all.txt
@@ -1,4 +1,5 @@
pandas>=0.20.2
pyyaml>=3.12
nbsphinx
attmap>=0.2
attmap>=0.4

8 changes: 4 additions & 4 deletions tests/divvy_tests/test_divvy.py
@@ -1,5 +1,5 @@
import pytest
from attmap import AttMap
from attmap import PathExAttMap
from tests.conftest import DCC_ATTRIBUTES, FILES

class DefaultDCCTests:
Expand Down Expand Up @@ -51,9 +51,9 @@ class GettingActivePackageTests:
""" Test for the get_active_package method"""

def test_settings_nonempty(self, dcc):
""" Test if get_active_package produces a nonempty AttMap object """
""" Test if get_active_package produces a nonempty PathExAttMap object """
settings = dcc.get_active_package()
assert settings != AttMap()
assert settings != PathExAttMap()


class ListingPackagesTests:
Expand Down Expand Up @@ -88,7 +88,7 @@ class UpdatingPackagesTests:
def test_update_packages(self, dcc, config_file):
""" Test updating does not produce empty compute packages """
dcc.update_packages(config_file)
assert dcc.compute_packages != AttMap()
assert dcc.compute_packages != PathExAttMap()



0 comments on commit b1b456f

Please sign in to comment.