Fix dark theme and seekpath species handling
Browse filesFiles changed (3)
46 unmodified lines474849505152535446 unmodified linesos.environ.setdefault("MPLCONFIGDIR", str(MPL_CACHE))APP_CSS = """:root { --imx-ink: #183b56; --imx-teal: #18a999; --imx-coral: #e07a5f; --imx-paper: #f7fafc; }body { background: #eef3f6; }.imx-shell { max-width: 1380px; margin: 0 auto; }.imx-hero { background: linear-gradient(125deg, #183b56 0%, #236477 58%, #18a999 100%); color: white; border-radius: 20px; padding: 30px 34px; margin-bottom: 18px; box-shadow: 0 14px 32px rgba(24,59,86,.16); }.imx-hero h1 { margin: 0 0 8px; font-size: 2.2rem; letter-spacing: -.03em; }46 unmodified lines474849505152535455565758596061626364656667686970717273747576777879808182838485868788899046 unmodified linesos.environ.setdefault("MPLCONFIGDIR", str(MPL_CACHE))APP_CSS = """:root { --imx-ink: #183b56; --imx-teal: #18a999; --imx-coral: #e07a5f; --imx-paper: #f7fafc; --imx-page: #102a43; --imx-panel: #183b56; --imx-text-muted: #c7d6df; color-scheme: dark; }html, body, .gradio-container { background: var(--imx-page) !important; color: var(--imx-paper) !important; }.gradio-container {--body-background-fill: var(--imx-page) !important;--background-fill-primary: var(--imx-panel) !important;--background-fill-secondary: var(--imx-page) !important;--body-text-color: var(--imx-paper) !important;--body-text-color-subdued: var(--imx-text-muted) !important;--block-background-fill: var(--imx-panel) !important;--block-info-text-color: var(--imx-text-muted) !important;--block-label-background-fill: var(--imx-teal) !important;--block-label-text-color: var(--imx-page) !important;--block-title-text-color: var(--imx-page) !important;--checkbox-label-text-color: var(--imx-paper) !important;--table-text-color: var(--imx-paper) !important;--table-even-background-fill: #214b63 !important;--table-odd-background-fill: var(--imx-panel) !important;--button-secondary-background-fill: #214b63 !important;--button-secondary-text-color: var(--imx-paper) !important;--input-background-fill: var(--imx-paper) !important;--input-background-fill-hover: #ffffff !important;--input-background-fill-focus: #ffffff !important;--input-placeholder-color: #597080 !important;}.gradio-container .prose,.gradio-container .prose p,.gradio-container .prose li,.gradio-container .prose h1,.gradio-container .prose h2,.gradio-container .prose h3,.gradio-container .prose h4,.gradio-container .prose blockquote,.gradio-container .label-wrap label,.gradio-container .block-info,.gradio-container .info,.gradio-container .description,.gradio-container .tab-nav button { color: var(--imx-paper) !important; }.gradio-container .imx-plot-heading { color: var(--imx-teal) !important; }.imx-shell { max-width: 1380px; margin: 0 auto; }.imx-hero { background: linear-gradient(125deg, #183b56 0%, #236477 58%, #18a999 100%); color: white; border-radius: 20px; padding: 30px 34px; margin-bottom: 18px; box-shadow: 0 14px 32px rgba(24,59,86,.16); }.imx-hero h1 { margin: 0 0 8px; font-size: 2.2rem; letter-spacing: -.03em; }
565 unmodified lines566567568569570571572573574575565 unmodified lines# lattice for the returned Cartesian q coordinates.cell_scale = float(np.max(np.linalg.norm(model_or_cell.cell, axis=1), initial=0.0))seekpath_cell = model_or_cell.cell / cell_scale if cell_scale > 0.0 else model_or_cell.cellstructure = (seekpath_cell,scaled_positions,[site.atom_type for site in model_or_cell.sites],)path_data = seekpath.get_path(structure)point_coordinates = path_data["point_coords"]565 unmodified lines566567568569570571572573574575576577578579580581565 unmodified lines# lattice for the returned Cartesian q coordinates.cell_scale = float(np.max(np.linalg.norm(model_or_cell.cell, axis=1), initial=0.0))seekpath_cell = model_or_cell.cell / cell_scale if cell_scale > 0.0 else model_or_cell.cellatom_type_numbers: dict[Any, int] = {}numbers: list[int] = []for site in model_or_cell.sites:if site.atom_type not in atom_type_numbers:atom_type_numbers[site.atom_type] = len(atom_type_numbers) + 1numbers.append(atom_type_numbers[site.atom_type])structure = (seekpath_cell,scaled_positions,numbers,)path_data = seekpath.get_path(structure)point_coordinates = path_data["point_coords"]
105 unmodified lines106107108109110111105 unmodified linesassert heatmap["max_eigenvalue"].shape == (3, 4)def test_empty_q_set_has_a_structured_empty_result():model = crystal(np.eye(3), [])result = exchange_fourier(model, np.empty((0, 3)), coordinates="fractional")105 unmodified lines106107108109110111112113114115116117118119120121122123124125126127128105 unmodified linesassert heatmap["max_eigenvalue"].shape == (3, 4)def test_seekpath_maps_named_atom_types_to_species_numbers():model = MagneticCrystal(cell=np.eye(3),sites=[MagneticSite(index=1, atom_type="Fe", position=(0.0, 0.0, 0.0), moment=1.0),MagneticSite(index=2, atom_type="Pt", position=(0.5, 0.0, 0.0), moment=1.0),],exchange_bonds=[],)path = high_symmetry_path(model, n_per_segment=2)assert path.source == "seekpath"assert path.tick_labels[0] == "GAMMA"assert "X" in path.tick_labelsdef test_empty_q_set_has_a_structured_empty_result():model = crystal(np.eye(3), [])result = exchange_fourier(model, np.empty((0, 3)), coordinates="fractional")
app.py+38-2
src/induced_exchange/reciprocal.py+7-1
tests/test_reciprocal.py+17