def test_c_custom_styles(self): print('\nCustom Styles (depthlimit=1, itemlimit=5):') sd.seedir(testdir, depthlimit=1, itemlimit=5, space='>>', split='>>', extend='II', final='->', folderstart='Folder: ', filestart='File: ')
def test_mask_no_folders_or_files(self): def foo(x): if os.path.isdir(x) or os.path.isfile(x): return False s = sd.seedir(testdir, printout=False, depthlimit=2, itemlimit=10, mask=foo,) s = s.split('\n') self.assertEqual(len(s), 1)
def test_mask_always_false(self): def bar(x): return False s = sd.seedir(testdir, printout=False, depthlimit=2, itemlimit=10, mask=bar) s = s.split('\n') self.assertEqual(len(s), 1)
def main(argv=None): if argv is None: argv = sys.argv[1:] path = os.getcwd() style = 'lines' depthlimit = 3 itemlimit = 10 beyond = 'content' sort = False sort_reverse = False try: opts, args = getopt.getopt(argv, help_letters, long_opts) except getopt.GetoptError: print(help_str) sys.exit(2) for opt, arg in opts: if opt == '-h': print(help_str) sys.exit() elif opt in ("-p", "--path"): path = arg elif opt in ("-y", "--style"): style = arg elif opt in ("-d", "--depthlimit"): depthlimit = arg elif opt in ("-i", "--itemlimit"): itemlimit = arg elif opt in ("-b", "--beyond"): beyond = arg elif opt in ("-s", "--sort"): sort = arg elif opt in ("-r", "--sort_reverse"): sort_reverse = arg s = sd.seedir(path=path, style=style, depthlimit=depthlimit, itemlimit=itemlimit, beyond=beyond, sort=sort, sort_reverse=sort_reverse, printout=False) print('\n', s, '\n', sep='')
include data for multiple decimation levels. The dataset in this example has been provided for use by the SAMTEX consortium. For more information, please refer to [Jones2009]_. Additional details about the dataset can be found at https://www.mtnet.info/data/kap03/kap03.html. """ # sphinx_gallery_thumbnail_number = 3 from pathlib import Path import seedir as sd import plotly import resistics.letsgo as letsgo # %% # Define the data path. This is dependent on where the data is stored. time_data_path = Path("..", "..", "data", "time", "quick", "kap123") sd.seedir(str(time_data_path), style="emoji") # %% # Get the spectra data. spec_data = letsgo.quick_spectra(time_data_path) # %% # Once the spectra data has been calculated, it can be plotted in a variety of # ways. The default plotting function plots the spectral data for multiple # decimation levels. fig = spec_data.plot() fig.update_layout(height=900) plotly.io.show(fig) # %% # It is also possible to plot spectra data for a particular decimation level.
easier to manage and use, especially when doing remote reference or intersite processing. The data in this example has been provided for use by the SAMTEX consortium. For more information, please refer to [Jones2009]_. Additional details about the data can be found at https://www.mtnet.info/data/kap03/kap03.html. """ from pathlib import Path import seedir as sd import plotly import resistics.letsgo as letsgo # %% # Let's remind ourselves of the project contents and then load the project. project_path = Path("..", "..", "data", "project", "kap03") sd.seedir(str(project_path), style="emoji") resenv = letsgo.load(project_path) # %% # Inspect the current configuration. As no custom configuration has been # specified, this will be the default configuration. resenv.config.summary() # %% # And it's always useful to know what transfer function will be calculated out. print(resenv.config.tf) # %% # Now let's run single site processing on a site and then look at the directory # structure again. Begin by transforming to frequency domain and reducing to the # evaluation frequencies. Note that whilst there is only a single measurement
def test_d_indent(self): print('\nDifferent Indents (depthlimit=1, itemlimit=5):') for i in list(range(3)) + [8]: print('\nindent={}:\n'.format(str(i))) sd.seedir(testdir, depthlimit=1, itemlimit=5, indent=i)
def test_b_styles(self): print('\nDifferent Styles (depthlimit=1, itemlimit=5):') for style in sd.STYLE_DICT.keys(): print('\n{}:\n'.format(style)) sd.seedir(testdir, style=style, depthlimit=1, itemlimit=5)
def test_a_print_userprofile(self): print('Basic seedir (depthlimit=2, itemlimit=10):\n') sd.seedir(testdir, depthlimit=2, itemlimit=10)
def test_improper_kwargs(self): with self.assertRaises(sd.SeedirError): sd.seedir(testdir, spacing=False)
def test_e_beyond(self): print( '\nItems Beyond Limit (depthlimit=1, itemlimit=1, beyond="content")' ) sd.seedir(testdir, itemlimit=1, beyond='content')