Skip to main content

SASA Database

I don't think this is usable by anyone lese but it's a dependency to sasa_stacker and I wanted to package it separately. An explanation to the whole project can be found here.

Usage

exl_to_sql.py -h:


exl_to_sql.py [-h] [-n SHEET_NUMBER] [-v] [-s] exl db

positional arguments:
  exl                   path to excel-file
  db                    path to sqlite3-db


optional arguments:
  -h, --help            show this help message and exit
  -n SHEET_NUMBER, --sheet-number SHEET_NUMBER
                        which excel-sheet to convert
  -v, --verbose         verbose output
  -s, --skip-existing   skipping rows already contained in the db

Writes the excel file exl into the sqlite database db. Every row in the Excel sheet represents one simulation run of metasurfaces. The problem is with our current setup they are saved as one big .mat file but the sasa_stacker needs to access them and their parameters individually. This script assigns each single metasurface an address and saves its parameters in the db separately. Examples for the formating of the excel sheet can be found in data/NN_smats.xlsx.

Crawler

The Crawler class allows access to the db and loads the simulation data. The main functions are:

find_smat

Crawler.find_smat(name, adress=None)

Loads the simulation data to name. If an adress is provided it only loads this single S-matrix.

Arguments

  • name: string, name of the simulation in the database
  • adress: list, for example [1,4,5,3] the adress can also be found in the database

find_smat_by_id

Crawler.find_smat_by_id(id)

Same as above but takes the simulation id

Arguments

  • id: int, simulation id found in the database

extract_params

Crawler.extract_params(id)

Queries meta_materials.db for all the parameters to the given ID.

Arguments

  • id: int, simulation id found in the database

Returns

  • param_dict: dict, contains the combined data from the simulations and geometry tables with coresponding names

Release files for sasa-db 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sasa-db 0.2
File Size Uploaded
sasa_db-0.2.tar.gz 10.6 kB Details

Release files / sasa_db-0.2.tar.gz

Download URL sasa_db-0.2.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
50a999b5edb45e6daa33a70f849c511f5c9213e0ba854010ceefec20aa7901c8
BLAKE2b-256 checksum
How to use checksums
77ac774b63eb51eaf5bd8e3d37ea5dfe253281cd88291f894f7d5e11000891d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page