yt.utilities.answer_testing.framework module

Title: framework.py Purpose: Contains answer tests that are used by yt’s various frontends

class yt.utilities.answer_testing.framework.AllFieldValuesTest(ds_fn, field, obj_type=None, decimals=None)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.AnswerTestCloudStorage(reference_name=None, answer_name=None)[source]

Bases: AnswerTestStorage

dump(result_storage)[source]
get(ds_name, default=None)[source]
progress_callback(current, total)[source]
class yt.utilities.answer_testing.framework.AnswerTestLocalStorage(reference_name=None, answer_name=None)[source]

Bases: AnswerTestStorage

dump(result_storage)[source]
get(ds_name, default=None)[source]
class yt.utilities.answer_testing.framework.AnswerTestStorage(reference_name=None, answer_name=None)[source]

Bases: object

dump(result_storage, result)[source]
get(ds_name, default=None)[source]
class yt.utilities.answer_testing.framework.AnswerTesting[source]

Bases: Plugin

addOptions(parser, env=None)

Add command-line options for this plugin.

The base plugin class adds –with-$name by default, used to enable the plugin.

Warning

Don’t implement addOptions unless you want to override all default option handling behavior, including warnings for conflicting options. Implement options instead.

add_options(parser, env=None)

Non-camel-case version of func name for backwards compatibility.

Warning

DEPRECATED: Do not use this method, use options instead.

can_configure = False
configure(options, conf)[source]

Configure the plugin and system, based on selected options.

The base plugin class sets the plugin to enabled if the enable option for the plugin (self.enableOpt) is true.

enableOpt = None
enabled = False
finalize(result=None)[source]
help()[source]

Return help for this plugin. This will be output as the help section of the –with-$name option that enables the plugin.

property my_version
name = 'answer-testing'
options(parser, env=environ({'PYDEVD_DISABLE_FILE_VALIDATION': '1', 'YT_BUILD': '/tmp/yt', 'VIRTUAL_ENV': '/tmp/yt/.venv', 'PWD': '/tmp/yt/doc', 'HOSTNAME': 'bfa84e4a8214', 'PS1': '(.venv) \\[\\e]0;\\u@\\h: \\w\\a\\]${debian_chroot:+($debian_chroot)}\\u@\\h:\\w\\$ ', 'OLDPWD': '/tmp/yt', 'VIRTUAL_ENV_PROMPT': '(.venv) ', 'MAKEFLAGS': '', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'MFLAGS': '', 'SHLVL': '1', 'PATH': '/tmp/yt/temp/bin:/home/ubuntu/.local/bin:/tmp/yt/.venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.swp=00;90:*.tmp=00;90:*.dpkg-dist=00;90:*.dpkg-old=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:', 'PYTHONPATH': '/tmp/yt:/tmp/yt/temp/lib/python3.11/site-packages', '_': '/usr/bin/make', 'MAKE_TERMOUT': '/dev/pts/0', 'CFLAGS': '-Wno-cpp -fno-strict-aliasing -O3 -march=native -pipe', 'GPERFTOOLS': 'yes', 'MAKE_TERMERR': '/dev/pts/0', 'HOME': '/home/ubuntu', 'TERM': 'xterm', 'MAKELEVEL': '1', 'LC_CTYPE': 'C.UTF-8', 'DOCUTILSCONFIG': '/tmp/yt/doc/source/docutils.conf'}))[source]

Register commandline options.

Implement this method for normal options behavior with protection from OptionConflictErrors. If you override this method and want the default –with-$name option to be registered, be sure to call super().

score = 100
tolist(val)
class yt.utilities.answer_testing.framework.AnswerTestingTest(ds_fn)[source]

Bases: object

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)[source]
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.AxialPixelizationTest(ds_fn, decimals=None)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.FieldValuesTest(ds_fn, field, obj_type=None, particle_type=False, decimals=10)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.GenericArrayTest(ds_fn, array_func, args=None, kwargs=None, decimals=None)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.GridHierarchyTest(ds_fn)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.GridValuesTest(ds_fn, field)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.ParentageRelationshipsTest(ds_fn)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.PhasePlotAttributeTest(ds_fn, x_field, y_field, z_field, attr_name, attr_args, decimals, plot_type='PhasePlot')[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(data_source, x_field, y_field, z_field, plot_type, plot_kwargs=None)[source]
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.PixelizedParticleProjectionValuesTest(ds_fn, axis, field, weight_field=None, obj_type=None)[source]

Bases: PixelizedProjectionValuesTest

answer_name = None
compare(new_result, old_result)
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.PixelizedProjectionValuesTest(ds_fn, axis, field, weight_field=None, obj_type=None)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.PlotWindowAttributeTest(ds_fn: str, plot_field: str, plot_axis: str, attr_name: str | None = None, attr_args: tuple | None = None, decimals: int | None = 12, plot_type: str | None = 'SlicePlot', callback_id: str | None = '', callback_runners: tuple | None = None)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.ProjectionValuesTest(ds_fn, axis, field, weight_field=None, obj_type=None, decimals=10)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
class yt.utilities.answer_testing.framework.VerifySimulationSameTest(simulation_obj)[source]

Bases: AnswerTestingTest

answer_name = None
compare(new_result, old_result)[source]
create_plot(ds, plot_type, plot_field, plot_axis, plot_kwargs=None)
property description
property entire_simulation

Return an unsorted array of values that cover the entire domain.

property max_dens_location

This is a helper function to return the location of the most dense point.

options = None
prefix = ''
reference_storage = None
result_storage = None
run()[source]
property sim_center

This returns the center of the domain.

property storage_name
yt.utilities.answer_testing.framework.big_patch_amr(ds_fn, fields, input_center='max', input_weight=('gas', 'density'))[source]
yt.utilities.answer_testing.framework.can_run_ds(ds_fn, file_check=False)[source]
yt.utilities.answer_testing.framework.compare_image_lists(new_result, old_result, decimals)[source]
yt.utilities.answer_testing.framework.create_obj(ds, obj_type)[source]
yt.utilities.answer_testing.framework.data_dir_load(ds_fn, cls=None, args=None, kwargs=None)[source]
yt.utilities.answer_testing.framework.data_dir_load_v2(fn, *args, **kwargs)[source]
yt.utilities.answer_testing.framework.dump_images(new_result, old_result, decimals=10)[source]
yt.utilities.answer_testing.framework.ensure_image_comparability(a, b)[source]
yt.utilities.answer_testing.framework.nbody_answer(ds, ds_str_repr, ds_nparticles, fields, center='c')[source]
yt.utilities.answer_testing.framework.requires_answer_testing()[source]
yt.utilities.answer_testing.framework.requires_ds(ds_fn, big_data=False, file_check=False)[source]
yt.utilities.answer_testing.framework.sim_dir_load(sim_fn, path=None, sim_type='Enzo', find_outputs=False)[source]
yt.utilities.answer_testing.framework.small_patch_amr(ds_fn, fields, input_center='max', input_weight=('gas', 'density'))[source]
yt.utilities.answer_testing.framework.sph_answer(ds, ds_str_repr, ds_nparticles, fields, center='c')[source]
yt.utilities.answer_testing.framework.temp_cwd(cwd)[source]