Commits

Chris Mutel committed e473f90

Compatibility with bw2data 0.11

  • Participants
  • Parent commits e7505ca

Comments (0)

Files changed (7)

+Changelog
+*********
+
+0.11 ()
+=======
+
+- BREAKING CHANGE: Graph traversal was reworked, and some functionality for interpreting the output was moved to ``bw2analyzer``.
+- FEATURE: Much better and more thorough documentation.
+- FEATURE: Improved testing and test coverage

bw2calc/__init__.py

 from .graph_traversal import GraphTraversal
 from .matrices import MatrixBuilder, TechnosphereBiosphereMatrixBuilder
 
-__version__ = (0, 10, 2)
+__version__ = (0, 11)

bw2calc/monte_carlo.py

             self.weighting_rng = MCRandomNumberGenerator(self.weighting_params, seed=self.seed)
 
     def next(self):
+        if not hasattr(self, "tech_rng"):
+            raise NameError("Must run `load_data` before making calculations")
         self.rebuild_technosphere_matrix(self.tech_rng.next())
         self.rebuild_biosphere_matrix(self.bio_rng.next())
         if self.lcia:

bw2calc/tests/lca.py

 class LCACalculationTestCase(BW2DataTest):
     def add_basic_biosphere(self):
         biosphere = Database("biosphere")
-        biosphere.register("Made for tests", [], 1)
+        biosphere.register(depends=[])
         biosphere.write({
             ("biosphere", 1): {
                 'categories': ['things'],
-                'code': 1,
                 'exchanges': [],
                 'name': 'an emission',
                 'type': 'emission',
             }
         self.add_basic_biosphere()
         test_db = Database("t")
-        test_db.register("Made for tests", ["biosphere"], 2)
+        test_db.register(depends=["biosphere"])
         test_db.write(test_data)
         test_db.process()
         lca = LCA({("t", 1): 1})
             }
         self.add_basic_biosphere()
         test_db = Database("t")
-        test_db.register("Made for tests", ["biosphere"], 2)
+        test_db.register(depends=["biosphere"])
         test_db.write(test_data)
         test_db.process()
         lca = LCA({("t", 1): 1})
             }
         self.add_basic_biosphere()
         test_db = Database("t")
-        test_db.register("Made for tests", ["biosphere"], 2)
+        test_db.register(depends=["biosphere"])
         test_db.write(test_data)
         test_db.process()
         lca = LCA({("t", 1): 1})
             }
         self.add_basic_biosphere()
         test_db = Database("t")
-        test_db.register("Made for tests", ["biosphere"], 2)
+        test_db.register(depends=["biosphere"])
         test_db.write(test_data)
         test_db.process()
         lca = LCA({("t", 1): 1})
             }
         self.add_basic_biosphere()
         test_db = Database("t")
-        test_db.register("Made for tests", ["biosphere"], 2)
+        test_db.register(depends=["biosphere"])
         test_db.write(test_data)
         test_db.process()
         lca = LCA({("t", 1): 1})
 # built documents.
 #
 # The short X.Y version.
-version = '0.10'
+version = '0.11'
 # The full version, including alpha/beta/rc tags.
-release = '0.10.2'
+release = '0.11'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
+bw2analyzer
+bw2data
 nose
 numpy>=1.6
 progressbar
 scipy
+stats_arrays>=0.2.2
 voluptuous
-bw2data>=0.10.1
-bw2analyzer>=0.4
-bw-stats-toolkit>=0.7
 
 setup(
     name='bw2calc',
-    version="0.10.2",
+    version="0.11",
     packages=["bw2calc", "bw2calc.tests", "bw2calc.sensitivity"],
     author="Chris Mutel",
     author_email="cmutel@gmail.com",
     install_requires=["brightway2"],
     long_description=open('README.rst').read(),
     classifiers=[
-        'Development Status :: 4 - Beta',
+        'Development Status :: 5 - Production/Stable',
         'Intended Audience :: End Users/Desktop',
         'Intended Audience :: Developers',
         'Intended Audience :: Science/Research',