Skip to content

Commit ee048c7

Browse files
committed
Allow new clik on windows, no fail on cosmo install os skip
1 parent f5ad3df commit ee048c7

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

cobaya/install.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def install(*infos, **kwargs):
198198
unknown_components = [] # could not be identified
199199
failed_components = [] # general errors
200200
obsolete_components = [] # older or unknown version already installed
201+
incompatible_components = [] # not compatible with current OS
201202
skip_keywords_arg = set(kwargs.get("skip") or [])
202203
# NB: if passed with quotes as `--skip "a b"`, it's interpreted as a single key
203204
skip_keywords_arg = set(chain(*[word.split() for word in skip_keywords_arg]))
@@ -304,10 +305,10 @@ def _imported_class():
304305
name_w_kind = imported_class.get_kind() + ":" + component
305306
is_compatible = getattr(imported_class, "is_compatible", lambda: True)()
306307
if not is_compatible:
307-
logger.error(
308+
logger.info(
308309
f"Skipping '{name_w_kind}' because it is not compatible with your OS."
309310
)
310-
failed_components += [name_w_kind]
311+
incompatible_components += [name_w_kind]
311312
continue
312313
logger.info("Checking if dependencies have already been installed...")
313314
is_installed = getattr(imported_class, "is_installed", None)
@@ -466,6 +467,12 @@ def _imported_class():
466467
),
467468
bullet + bullet.join(obsolete_components),
468469
)
470+
if incompatible_components:
471+
logger.info(
472+
"The following components were skipped because they are not compatible "
473+
"with your OS: %s",
474+
bullet + bullet.join(incompatible_components),
475+
)
469476
if not unknown_components and not failed_components and not obsolete_components:
470477
logger.info(
471478
"All requested components' dependencies correctly installed at "

cobaya/likelihoods/base_classes/planck_clik.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,6 @@ def close(self):
180180
def get_code_path(cls, path):
181181
return os.path.realpath(os.path.join(path, "code", common_path))
182182

183-
@classmethod
184-
def is_compatible(cls):
185-
import platform
186-
187-
return platform.system() != "Windows"
188-
189183
@classmethod
190184
def is_installed(cls, reload=False, **kwargs):
191185
code_path = common_path
@@ -225,11 +219,6 @@ def install(
225219
name = cls.get_qualified_class_name()
226220
log = get_logger(name)
227221
path_names = {"code": common_path, "data": get_data_path(name)}
228-
import platform
229-
230-
if platform.system() == "Windows":
231-
log.error("Not compatible with Windows.")
232-
return False
233222
global _clipy_install_failed
234223
if _clipy_install_failed:
235224
log.info("Previous clipy install failed, skipping")

0 commit comments

Comments
 (0)