Skip to content

Commit

Permalink
add some warnings for non linux users and other connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonk committed Sep 30, 2024
1 parent 6fba5c0 commit bd7a5c2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pastastore/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import warnings
from concurrent.futures import ProcessPoolExecutor
from functools import partial
from platform import system as os_system
from typing import Dict, List, Literal, Optional, Tuple, Union

import numpy as np
Expand Down Expand Up @@ -1226,7 +1227,21 @@ def solve_models(
ignore_solve_errors=ignore_solve_errors,
**kwargs,
)
if self.conn.__class__.__name__ != "PasConnector":
parallel = False
logger.error(
"Parallel solving only supported for PasConnector databases."
"Setting parallel to `False`"
)

if parallel:
if os_system() != "Linux":
logger.warning(
"Parallel solving is experimental on other operating "
"systems than Linux. Please use an "
"`if __name__==__main__:` statement before the "
"`solve_models` method."
)
with ProcessPoolExecutor(max_workers=max_workers) as executor:
if progressbar:
_ = list(
Expand Down

0 comments on commit bd7a5c2

Please sign in to comment.