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))
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
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)))
def setUp(self): self.path = __dbpath__ self.dir = temp_path() self.alternatepath = self.dir / __dbpath__.name
def test_is_dir(self): self.assertTrue(temp_path().is_dir())
def setUp(self): self.fromdir = temp_path() / ("testmelts" + self.__class__.__name__) self.fromdir.mkdir(parents=True) self.meltsfile = MELTSFILE self.env = ENV # use default
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)
def setUp(self): self.X, self.y = sklearn.datasets.load_iris(return_X_y=True) self.classifier = test_classifier() self.dir = temp_path()
def setUp(self): self.temp_dir = temp_path() / "test_melts_temp" self.dir = temp_path() / "test_melts_install"