from sqlalchemy import Column, Float, Text, Integer

from ..database import DB

Base = DB.Base


class C2db(Base):
    __tablename__ = "c2db"
    ID = Column('ID', Integer, primary_key=True, unique=True, index=True)
    Unique_identifier = Column('Unique identifier', Text)
    Formula = Column('Formula', Text)
    Material_class = Column('Material class', Text)
    Space_group = Column('Space group', Text)
    Magnetic = Column('Magnetic', Text)
    Heat_of_formation = Column('Heat of formation', Float)
    Band_gap = Column('Band gap', Float)
    Crystal_type = Column('Crystal type', Text)
    two_dimension_plasma_frequency_x = Column('2D plasma frequency (x)', Float)
    two_dimension_plasma_frequency_y = Column('2D plasma frequency (y)', Float)
    First_class_material = Column('First class material', Text)
    Calculator = Column('Calculator', Text)
    Anisotropic_exchange_out_of_plane = Column('Anisotropic exchange (out-of-plane)', Text)
    Area_of_unit_cell = Column('Area of unit-cell', Float)
    Band_gap_G0W0 = Column('Band gap (G₀W₀)', Float)
    Band_gap_HSE06 = Column('Band gap (HSE06)', Float)
    Topology = Column('Topology', Text)
    Conduction_band_effective_mass_direction_1 = Column('Conduction band effective mass, direction 1', Float)
    Conduction_band_effective_mass_direction_2 = Column('Conduction band effective mass, direction 2', Float)
    Cond_band_minimum = Column('Cond. band minimum', Float)
    Conduction_band_minimum_G0W0 = Column('Conduction band minimum (G₀W₀)', Float)
    Conduction_band_minimum_HSE06 = Column('Conduction band minimum (HSE06)', Float)
    DOS_at_ef = Column('DOS at ef', Float)
    DOS_at_ef_no_soc = Column('DOS at ef no soc.', Float)
    Dir_band_gap = Column('Dir. band gap', Float)
    Direct_band_gap_G0W0 = Column('Direct band gap (G₀W₀)', Float)
    Direct_band_gap_HSE06 = Column('Direct band gap (HSE06)', Float)
    Dir_gap_wo_soc = Column('Dir. gap wo. soc.', Float)
    Energy_above_convex_hull = Column('Energy above convex hull', Float)
    Exc_bind_energy = Column('Exc. bind. energy', Float)
    Fermi_level = Column('Fermi level', Float)
    Gap_wo_soc = Column('Gap wo. soc.', Float)
    Magnetic_anisotropy_z_x = Column('Magnetic anisotropy (E<sub>z</sub> - E<sub>x</sub>)', Float)
    Magnetic_anisotropy_z_y = Column('Magnetic anisotropy (E<sub>z</sub> - E<sub>y</sub>)', Float)
    Magnetic_easy_axis = Column('Magnetic easy axis', Text)
    Magnetic_moment = Column('Magnetic moment', Float)
    Magnetic_state = Column('Magnetic state', Text)
    Material_has_inversion_symmetry = Column('Material has inversion symmetry', Text)
    Material_unique_ID = Column('Material unique ID', Text)
    Maximum_force = Column('Maximum force', Float)
    Maximum_stress = Column('Maximum stress', Float)
    Maximum_value_of_S_z_at_magnetic_sites = Column('Maximum value of S_z at magnetic sites', Float)
    Minimum_eigenvalue_of_Hessian = Column('Minimum eigenvalue of Hessian', Float)
    Monolayer_reported_DOI = Column('Monolayer reported DOI', Text)
    Nearest_neighbor_exchange_coupling = Column('Nearest neighbor exchange coupling', Float)
    Charge = Column('Charge', Float)
    Number_of_atoms = Column('Number of atoms', Float)
    Number_of_nearest_neighbors = Column('Number of nearest neighbors', Float)
    n_spins = Column('n-spins', Float)
    Out_of_plane_dipole_along_plus_z_axis = Column('Out-of-plane dipole along +z axis', Float)
    Path_to_collection_folder = Column('Path to collection folder', Text)
    PBC = Column('PBC', Text)
    Phonon_dynamic_stability_lowOrHigh = Column('Phonon dynamic stability (low/high)', Text)
    Point_group = Column('Point group', Text)
    Related_COD_id = Column('Related COD id', Text)
    Unique_ID = Column('Unique ID', Text)
    Related_ICSD_id = Column('Related ICSD id', Text)
    Single_ion_anisotropy_out_of_plane = Column('Single-ion anisotropy (out-of-plane)', Float)
    Soc_total_energy_x_direction = Column('Soc. total energy, x-direction', Float)
    Soc_total_energy_y_direction = Column('Soc. total energy, y-direction', Float)
    Soc_total_energy_z_direction = Column('Soc. total energy, z-direction', Float)
    Space_group_number = Column('Space group number', Integer)
    Speed_of_sound_x = Column('Speed of sound (x)', Float)
    Speed_of_sound_y = Column('Speed of sound (y)', Float)
    Static_interband_polarizability_x = Column('Static interband polarizability (x)', Float)
    Static_interband_polarizability_y = Column('Static interband polarizability (y)', Float)
    Static_interband_polarizability_z = Column('Static interband polarizability (z)', Float)
    Static_lattice_polarizability_x = Column('Static lattice polarizability (x)', Float)
    Static_lattice_polarizability_y = Column('Static lattice polarizability (y)', Float)
    Static_lattice_polarizability_z = Column('Static lattice polarizability (z)', Float)
    Static_total_polarizability_x = Column('Static total polarizability (x)', Float)
    Static_total_polarizability_y = Column('Static total polarizability (y)', Float)
    Static_total_polarizability_z = Column('Static total polarizability (z)', Float)
    Stiffness_dynamic_stability_lowOrHigh = Column('Stiffness dynamic stability (low/high)', Text)
    Stiffness_tensor_11_component = Column('Stiffness tensor, 11-component', Float)
    Stiffness_tensor_12_component = Column('Stiffness tensor, 12-component', Float)
    Stiffness_tensor_13_component = Column('Stiffness tensor, 13-component', Float)
    Stiffness_tensor_21_component = Column('Stiffness tensor, 21-component', Float)
    Stiffness_tensor_22_component = Column('Stiffness tensor, 22-component', Float)
    Stiffness_tensor_23_component = Column('Stiffness tensor, 23-component', Float)
    Stiffness_tensor_31_component = Column('Stiffness tensor, 31-component', Float)
    Stiffness_tensor_32_component = Column('Stiffness tensor, 32-component', Float)
    Stiffness_tensor_33_component = Column('Stiffness tensor, 33-component', Float)
    Stoichiometry = Column('Stoichiometry', Text)
    Mass = Column('Mass', Float)
    Thermodynamic_stability_level = Column('Thermodynamic stability level', Float)
    Age = Column('Age', Text)
    Energy = Column('Energy', Float)
    Username = Column('Username', Text)
    Vacuum_level = Column('Vacuum level', Float)
    Vacuum_level_difference = Column('Vacuum level difference', Float)
    Valence_band_effective_mass_direction_1 = Column('Valence band effective mass, direction 1', Float)
    Valence_band_effective_mass_direction_2 = Column('Valence band effective mass, direction 2', Float)
    Valence_band_maximum_G0W0 = Column('Valence band maximum (G₀W₀)', Float)
    Valence_band_maximum_HSE06 = Column('Valence band maximum (HSE06)', Float)
    Volume = Column('Volume', Float)
    Work_function_avg_if_finite_dipole = Column('Work function (avg. if finite dipole)', Float)
    cif = Column('cif', Text)
