'Calculate the state changes necessary to make ``discovered_dataset``
state match ``desired_dataset`` configuration.
:param discovered_dataset: The current state of the dataset.
:type discovered_dataset: ``DiscoveredDataset`` or ``None``
:param desired_dataset: The desired state of the dataset.
:type desired_dataset: ``DesiredDataset`` or ``None``'

def _calculate_dataset_change(self, discovered_dataset, desired_dataset):

    desired_state = (desired_dataset.state if (desired_dataset is not None) else DatasetStates.NON_MANIFEST)
    discovered_state = (discovered_dataset.state if (discovered_dataset is not None) else DatasetStates.NON_EXISTENT)
    if (desired_state != discovered_state):
        transition = self.transitions[desired_state][discovered_state]
        return transition.from_state_and_config(discovered_dataset=discovered_dataset, desired_dataset=desired_dataset)
    else:
        return NOTHING_TO_DO
