Skip to content

Commit

Permalink
make mesa runable without some dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Corvince committed Jan 9, 2024
1 parent ee060de commit 757993f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
5 changes: 4 additions & 1 deletion mesa/datacollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
import types
from functools import partial

import pandas as pd
try:
import pandas as pd
except ImportError:
pass

Check warning on line 44 in mesa/datacollection.py

View check run for this annotation

Codecov / codecov/patch

mesa/datacollection.py#L43-L44

Added lines #L43 - L44 were not covered by tests


class DataCollector:
Expand Down
5 changes: 4 additions & 1 deletion mesa/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
from typing import Any, Callable, TypeVar, Union, cast, overload
from warnings import warn

import networkx as nx
try:
import networkx as nx
except ImportError:
pass

Check warning on line 33 in mesa/space.py

View check run for this annotation

Codecov / codecov/patch

mesa/space.py#L32-L33

Added lines #L32 - L33 were not covered by tests
import numpy as np
import numpy.typing as npt

Expand Down
11 changes: 7 additions & 4 deletions mesa/visualization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from mesa_viz_tornado.ModularVisualization import * # noqa
from mesa_viz_tornado.modules import * # noqa
from mesa_viz_tornado.UserParam import * # noqa
from mesa_viz_tornado.TextVisualization import * # noqa
try:
from mesa_viz_tornado.ModularVisualization import * # noqa
from mesa_viz_tornado.modules import * # noqa
from mesa_viz_tornado.UserParam import * # noqa
from mesa_viz_tornado.TextVisualization import * # noqa
except ImportError:
pass

Check warning on line 7 in mesa/visualization/__init__.py

View check run for this annotation

Codecov / codecov/patch

mesa/visualization/__init__.py#L6-L7

Added lines #L6 - L7 were not covered by tests

0 comments on commit 757993f

Please sign in to comment.