





'''simple docstring'''







import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict






@pytest.mark.parametrize(
    "split_dict"       ,				[
        SplitDict(),
        SplitDict({"train": SplitInfo(name="train"       ,				num_bytes=1337       ,				num_examples=42       ,				dataset_name="my_dataset"		)}		),
        SplitDict({"train": SplitInfo(name="train"       ,				num_bytes=1337       ,				num_examples=42		)}		),
        SplitDict({"train": SplitInfo()}		),
    ]       ,				)
def 					_lowerCamelCase							(					lowercase		: SplitDict		)      ->      Any:
				_a				      =					split_dict._to_yaml_list()
				assert len(lowercase		) == len(lowercase		)
				_a				      =					SplitDict._from_yaml_list(lowercase		)
				for split_name, split_info in split_dict.items():
								# dataset_name field is deprecated, and is therefore not part of the YAML dump
								_a				      =					None
								# the split name of split_dict takes over the name of the split info object
								_a				      =					split_name
				assert split_dict == reloaded






@pytest.mark.parametrize(
    "split_info"       ,				[SplitInfo(), SplitInfo(dataset_name=lowercase		), SplitInfo(dataset_name="my_dataset"		)]		)
def 					_lowerCamelCase							(					lowercase		: Optional[Any]		)      ->      Tuple:
				_a				      =					asdict(SplitDict({"train": split_info}		)		)
				assert "dataset_name" in split_dict_asdict["train"]
				assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name







"""simple docstring"""





from math import log

from scipy.constants import Boltzmann, physical_constants

SCREAMING_SNAKE_CASE__   =  300  # TEMPERATURE (unit = K)


def      UpperCAmelCase__				(    SCREAMING_SNAKE_CASE	:		float				,		SCREAMING_SNAKE_CASE	:		float				,		SCREAMING_SNAKE_CASE	:		float				,		):







      '''simple docstring'''




      if donor_conc <= 0:
            raise ValueError("""Donor concentration should be positive"""     )
      elif acceptor_conc <= 0:
            raise ValueError("""Acceptor concentration should be positive"""     )
      elif intrinsic_conc <= 0:
            raise ValueError("""Intrinsic concentration should be positive"""     )
      elif donor_conc <= intrinsic_conc:
            raise ValueError(
                """Donor concentration should be greater than intrinsic concentration"""     )
      elif acceptor_conc <= intrinsic_conc:
            raise ValueError(
                """Acceptor concentration should be greater than intrinsic concentration"""     )
      else:
            return (
                Boltzmann
                * T
                * log((donor_conc * acceptor_conc) / intrinsic_conc**2     )
                / physical_constants["electron volt"][0]
            )


if __name__ == "__main__":
       import doctest

       doctest.testmod()






