File IO Module#

class nexus.fileio.TextFile(filepath=None)[source]#

Bases: DevBase

Methods

append(value)

class_error(message[, header, exit, trace, ...])

Report an error relating to a class.

close()

error(message[, header, exit, trace])

Report an error inside a class.

find(*a, **kw)

first()

keys()

list(*keys)

open_log(filepath)

save([fpath])

sorted_keys()

warn(msg[, indent])

Warning from inside a Nexus class.

add

add_optional

check_required

check_types

check_types_optional

class_get

class_has

class_items

class_keys

class_log

class_set

class_set_optional

class_set_single

class_warn

clear

close_log

copy

copy_from

copy_to

data_repr

delete

delete_optional

delete_required

dict

extract

extract_optional

flush

get

get_optional

get_path

get_required

inverse

items

last

lines

list_optional

load

log

move

move_from

move_from_optional

move_to

move_to_optional

not_implemented

obj

open

path_exists

random_key

read

read_byte

readline

readtokens

readtokensf

resize

rfind

seek

select_random

serial

set

set_optional

set_path

shallow_copy

size

tell

to_dict

to_obj

tokens

transfer_from

transfer_to

tree

tuple

values

write

write_byte

open(filepath)[source]#
lines()[source]#
tokens()[source]#
readtokens(s=None)[source]#
readtokensf(s=None, *formats)[source]#
close()[source]#
seek(pos, whence=0, start=None, end=None)[source]#
readline(s=None)[source]#
read(num=None)[source]#
find(*a, **kw)[source]#
flush(*a, **kw)[source]#
move(dest, src, count)[source]#
read_byte()[source]#
resize(newsize)[source]#
rfind(*a, **kw)[source]#
size()[source]#
tell()[source]#
write(string)[source]#
write_byte(byte)[source]#
class nexus.fileio.StandardFile(filepath=None)[source]#

Bases: DevBase

Methods

append(value)

class_error(message[, header, exit, trace, ...])

Report an error relating to a class.

error(message[, header, exit, trace])

Report an error inside a class.

first()

keys()

list(*keys)

open_log(filepath)

save([fpath])

sorted_keys()

warn(msg[, indent])

Warning from inside a Nexus class.

add

add_optional

check_required

check_types

check_types_optional

check_valid

class_get

class_has

class_items

class_keys

class_log

class_set

class_set_optional

class_set_single

class_warn

clear

close_log

copy

copy_from

copy_to

data_repr

delete

delete_optional

delete_required

dict

extract

extract_optional

get

get_optional

get_path

get_required

inverse

is_valid

items

last

list_optional

load

log

move_from

move_from_optional

move_to

move_to_optional

not_implemented

obj

path_exists

random_key

read

read_text

select_random

serial

set

set_optional

set_path

shallow_copy

to_dict

to_obj

transfer_from

transfer_to

tree

tuple

validity_checks

values

write

write_text

sftype = ''#
read(filepath)[source]#
write(filepath=None)[source]#
is_valid()[source]#
check_valid(header=None)[source]#
validity_checks()[source]#
read_text(text)[source]#
write_text()[source]#
class nexus.fileio.XsfFile(filepath=None, order=None)[source]#

Bases: StandardFile

Methods

append(value)

change_units(in_unit, out_unit)

class_error(message[, header, exit, trace, ...])

Report an error relating to a class.

error(message[, header, exit, trace])

Report an error inside a class.

first()

incorporate_structure(structure)

interpolate_plane(r1, r2, r3[, density, ...])

keys()

line_data(dim[, density])

list(*keys)

norm([density, vnorm])

open_log(filepath)

read_text(text[, order])

remove_ghost([density])

save([fpath])

sorted_keys()

warn(msg[, indent])

Warning from inside a Nexus class.

write_text()

add

add_density

add_optional

add_to_image

check_required

check_types

check_types_optional

check_valid

class_get

class_has

class_items

class_keys

class_log

class_set

class_set_optional

class_set_single

class_warn

clear

close_log

copy

copy_from

copy_to

data_repr

delete

delete_optional

delete_required

dict

dimension

extract

extract_optional

get

get_density

get_optional

get_path

get_required

has_animation

has_bands

has_data

has_structure

initialized

inverse

is_valid

items

last

line_plot

list_optional

load

log

move_from

move_from_optional

move_to

move_to_optional

not_implemented

obj

path_exists

random_key

read

select_random

serial

set

set_optional

set_path

shallow_copy

to_dict

to_obj

transfer_from

transfer_to

tree

tuple

validity_checks

values

write

write_band

write_coord

write_data

write_vec

sftype = 'xsf'#
filetypes = {'axsf', 'bxsf', 'xsf'}#
periodicities = {'crystal', 'molecule', 'polymer', 'slab'}#
dimensions = crystal               int                    molecule              int                    polymer               int                    slab                  int                  #
add_to_image(image, name, value)[source]#
read_text(text, order=None)[source]#
write_text()[source]#
write_coord(image=None, index='')[source]#
write_vec(name, vec, index='')[source]#
write_data()[source]#
write_band()[source]#
dimension()[source]#
initialized()[source]#
has_animation()[source]#
has_bands()[source]#
has_structure()[source]#
has_data()[source]#
validity_checks()[source]#
incorporate_structure(structure)[source]#
add_density(cell, density, name='density', corner=None, grid=None, centered=False, add_ghost=False)[source]#
get_density()[source]#
change_units(in_unit, out_unit)[source]#
remove_ghost(density=None)[source]#
norm(density=None, vnorm=True)[source]#
line_data(dim, density=None)[source]#
line_plot(dim, filepath)[source]#
interpolate_plane(r1, r2, r3, density=None, meshsize=50, fill_value=0)[source]#
class nexus.fileio.PoscarFile(filepath=None)[source]#

Bases: StandardFile

Methods

append(value)

class_error(message[, header, exit, trace, ...])

Report an error relating to a class.

error(message[, header, exit, trace])

Report an error inside a class.

first()

keys()

list(*keys)

open_log(filepath)

save([fpath])

sorted_keys()

warn(msg[, indent])

Warning from inside a Nexus class.

add

add_optional

assign_defaults

check_required

check_types

check_types_optional

check_valid

class_get

class_has

class_items

class_keys

class_log

class_set

class_set_optional

class_set_single

class_warn

clear

close_log

copy

copy_from

copy_to

data_repr

delete

delete_optional

delete_required

dict

extract

extract_optional

get

get_optional

get_path

get_required

incorporate_xsf

inverse

is_valid

items

last

list_optional

load

log

move_from

move_from_optional

move_to

move_to_optional

not_implemented

obj

path_exists

random_key

read

read_text

select_random

serial

set

set_optional

set_path

shallow_copy

to_dict

to_obj

transfer_from

transfer_to

tree

tuple

validity_checks

values

write

write_text

sftype = 'POSCAR'#
assign_defaults()[source]#
validity_checks()[source]#
read_text(text)[source]#
write_text()[source]#
incorporate_xsf(xsf)[source]#
class nexus.fileio.ChgcarFile(filepath=None)[source]#

Bases: StandardFile

Methods

append(value)

class_error(message[, header, exit, trace, ...])

Report an error relating to a class.

error(message[, header, exit, trace])

Report an error inside a class.

first()

keys()

list(*keys)

open_log(filepath)

save([fpath])

sorted_keys()

warn(msg[, indent])

Warning from inside a Nexus class.

add

add_optional

check_required

check_types

check_types_optional

check_valid

class_get

class_has

class_items

class_keys

class_log

class_set

class_set_optional

class_set_single

class_warn

clear

close_log

copy

copy_from

copy_to

data_repr

delete

delete_optional

delete_required

dict

extract

extract_optional

get

get_optional

get_path

get_required

incorporate_xsf

inverse

is_valid

items

last

list_optional

load

log

move_from

move_from_optional

move_to

move_to_optional

not_implemented

obj

path_exists

random_key

read

read_text

select_random

serial

set

set_optional

set_path

shallow_copy

to_dict

to_obj

transfer_from

transfer_to

tree

tuple

validity_checks

values

write

write_text

sftype = 'CHGCAR'#
validity_checks()[source]#
read_text(text)[source]#
write_text()[source]#
incorporate_xsf(xsf)[source]#
nexus.fileio.read_poscar_chgcar(host, text)[source]#