Exemplo n.º 1
0
 def setUp(self):
     self.dir = temp_path()
     names = ["a", "b", "c"]
     self.files = [self.dir / "{}.csv".format(n) for n in names]
     for n, fn in zip(names, self.files):  # make some csvs
         with open(str(fn), "w") as f:
             f.write("C1,C{}\n{},{}\n{},{}".format(n, n, n, n, n))
Exemplo n.º 2
0
 def setUp(self):
     self.fromdir = temp_path() / ("testmelts" + self.__class__.__name__)
     self.fromdir.mkdir(parents=True)
     Gale_MORB = get_reference_composition("MORB_Gale2013")
     majors = [
         "SiO2",
         "Al2O3",
         "FeO",
         "MnO",
         "MgO",
         "CaO",
         "Na2O",
         "TiO2",
         "K2O",
         "P2O5",
     ]
     MORB = Gale_MORB.comp.loc[:, majors].apply(pd.to_numeric)
     MORB = MORB.append(MORB).reset_index().drop(columns="index")
     MORB["Title"] = [
         "{}_{}".format(Gale_MORB.name, ix).replace("_", "")
         for ix in MORB.index.values.astype(str)
     ]
     MORB["Initial Temperature"] = 1300
     MORB["Final Temperature"] = 800
     MORB["Initial Pressure"] = 5000
     MORB["Final Pressure"] = 5000
     MORB["Log fO2 Path"] = "FMQ"
     MORB["Increment Temperature"] = -5
     MORB["Increment Pressure"] = 0
     self.df = MORB
     self.env = ENV
Exemplo n.º 3
0
 def setUp(self):
     self.dir = temp_path()
     self.fn = self.dir / "test_read_table.csv"
     self.files = [self.fn.with_suffix(s) for s in [".csv"]]  # ".xlsx",
     self.expect = pd.DataFrame(np.ones((2, 2)),
                                columns=["C1", "C2"],
                                index=["i0", "i1"])
     for fn, ex in zip(self.files,
                       ["to_csv"]):  # make some csvs # "to_excel",
         kw = dict()  # engine="openpyxl"
         getattr(self.expect, ex)(str(fn),
                                  **subkwargs(kw, getattr(self.expect, ex)))
Exemplo n.º 4
0
 def setUp(self):
     self.path = __dbpath__
     self.dir = temp_path()
     self.alternatepath = self.dir / __dbpath__.name
Exemplo n.º 5
0
 def test_is_dir(self):
     self.assertTrue(temp_path().is_dir())
Exemplo n.º 6
0
 def setUp(self):
     self.fromdir = temp_path() / ("testmelts" + self.__class__.__name__)
     self.fromdir.mkdir(parents=True)
     self.meltsfile = MELTSFILE
     self.env = ENV  # use default
Exemplo n.º 7
0
 def setUp(self):
     self.tmppath = temp_path(suffix="refdbtest")
     self.name = "refdb.json"
     self.path = self.tmppath / self.name
     if not self.tmppath.exists():
         self.tmppath.mkdir(parents=True)
Exemplo n.º 8
0
 def setUp(self):
     self.X, self.y = sklearn.datasets.load_iris(return_X_y=True)
     self.classifier = test_classifier()
     self.dir = temp_path()
Exemplo n.º 9
0
 def setUp(self):
     self.temp_dir = temp_path() / "test_melts_temp"
     self.dir = temp_path() / "test_melts_install"