SavedSettings#

class stellarphot.settings.SavedSettings(_testing_path=None, _create_path=True)[source]#

Bases: object

Handle loading and saving of settings files from disk.

Parameters:
_testing_pathPath, optional

Path to use for testing purposes. If not provided, the default path is used.

_create_pathbool, optional

If True, the directory where settings files are stored is created if it does not exist. If False, the directory is not created, which is useful for testing.

Attributes Summary

cameras

Cameras stored in the settings.

observatories

Observatories stored in the settings.

passband_maps

Passband maps stored in the settings.

settings_path

Path to the directory where settings files are stored.

Methods Summary

add_item(item)

Add an item to the settings.

delete([confirm, delete_settings_folder])

Delete all settings files.

delete_item(item[, confirm])

Delete an item from the settings.

get_items(item_type)

Get the items of a given type.

Attributes Documentation

cameras#

Cameras stored in the settings.

observatories#

Observatories stored in the settings.

passband_maps#

Passband maps stored in the settings.

settings_path#

Path to the directory where settings files are stored.

Methods Documentation

add_item(item)[source]#

Add an item to the settings.

Parameters:
itemCamera | Observatory | PassbandMap

The item to add.

delete(confirm=False, delete_settings_folder=False)[source]#

Delete all settings files.

Parameters:
confirmbool, optional

If True, the files are deleted. If False, a ValueError is raised.

delete_settings_folderbool, optional

If True, the directory where settings files are stored is deleted. If False, only the settings files are deleted.

delete_item(item, confirm=False)[source]#

Delete an item from the settings.

Parameters:
itemCamera | Observatory | PassbandMap

The item to delete.

confirmbool, optional

If True, the item is deleted. If False, a ValueError is raised.

get_items(item_type)[source]#

Get the items of a given type.

Parameters:
item_typestr | Camera | Observatory | PassbandMap

The type of item to get.