text
stringlengths 10
968k
| id
stringlengths 14
122
| metadata
dict | __index_level_0__
int64 0
242
|
|---|---|---|---|
from autosweep.data_types import filereader, metadata, recipe, station_config
from autosweep.data_types.filereader import (
FileWRer,
GeneralIOClass,
)
from autosweep.data_types.metadata import (
PN,
SN,
DUTInfo,
MetaNum,
TimeStamp,
)
from autosweep.data_types.recipe import (
Recipe,
)
from autosweep.data_types.station_config import (
StationConfig,
)
__all__ = [
"DUTInfo",
"FileWRer",
"GeneralIOClass",
"MetaNum",
"PN",
"Recipe",
"SN",
"StationConfig",
"TimeStamp",
"filereader",
"metadata",
"recipe",
"station_config",
]
|
autosweep/autosweep/data_types/__init__.py/0
|
{
"file_path": "autosweep/autosweep/data_types/__init__.py",
"repo_id": "autosweep",
"token_count": 263
}
| 0
|
from autosweep.instruments import abs_instr
from autosweep.instruments.coms import visa_coms
class Keysight8164B(abs_instr.AbsInstrument):
"""
Driver written by Helge Gehring, modified to work with AutoSweep.
:param addrs: The VISA-resource string for this instrument
:type addrs: str
"""
def __init__(self, addrs: str):
super().__init__(com=visa_coms.VisaCOM(addrs=addrs))
def idn_ask(self):
return self.com.query("*IDN?")
def system_error_ask(self):
return self.com.query(":system:error?")
def source_channel_wavelength(self, source, channel, wavelength):
"""
Sets the absolute wavelength of the output.
:param wavelength:
Any wavelength in the specified range (see the specifications in the appropriate User’s Guide).
The programmable range is larger than the range specified in the User’s Guide. The programmable range is set individually
for each instrument when it is calibrated during production.
:return:
"""
self.com.write(
(f":source{source}" if source else "")
+ (f":channel{channel}" if channel else "")
+ f":wavelength {wavelength}"
)
def source_channel_wavelength_sweep_softtrigger(self, source=None, channel=None):
self.com.write(
(f":source{source}" if source else "")
+ (f":channel{channel}" if channel else "")
+ ":wavelength"
+ ":sweep"
+ ":softtrigger"
)
def source_channel_wavelength_sweep_state(self, source, channel, state):
"""
Stops, starts, pauses or continues a wavelength sweep.
:param state:
0 or STOP: Stop the sweep.
1 or STARt: Start a sweep, run sweep.
2 or PAUSe: Pause the sweep. (doesn’t apply for continuous sweep)
3 or CONTinue: Continue a sweep. (doesn’t apply for continuous sweep)
If you enable lambda logging (see [:SOURce[n]][:CHANnel[m]]:WAVelength:SWEep:LLOGging on
page 170 ) and modulation (see [:SOURce[n]][:CHANnel[m]]:AM:STATe[l] on page 127 ) simultaneously, a
sweep cannot be started.
Generally, a continuous sweep can only be started if:
the trigger frequency, derived from the sweep speed and sweep step, is <= 40kHz, or <=1MHz for 81602A, 81606A, 81607A,
81608A, and 81960A.
the number of triggers, calculated from the sweep span and sweep span, is <=100001
the start wavelength is less than the stop wavelength.
In addition, a continuous sweep with lambda logging requires:
the trigger output to be set to step finished
modulation set to coherence control or off.
"""
self.com.write(
(f":source{source}" if source else "")
+ (f":channel{channel}" if channel else "")
+ ":wavelength"
+ ":sweep"
+ f":state {state}"
)
def source_channel_wavelength_sweep_state_ask(self, source=None, channel=None):
"""
Returns the state of a sweep.
:return: True if running
"""
return "+1" in self.com.query(
(f":source{source}" if source else "")
+ (f":channel{channel}" if channel else "")
+ ":wavelength"
+ ":sweep"
+ ":state?"
)
def trigger_channel_output(self, trigger, channel, mode):
"""
Specifies when an output trigger is generated and arms the module.
:param trigger:
:param channel:
:param mode:
DISabled: Never.
AVGover: When averaging time period finishes.
MEASure: When averaging time period begins.
MODulation: For every leading edge of a digitally-modulated (TTL) signal
STFinished: When a sweep step finishes.
SWFinished: When sweep cycle finishes.
SWSTarted: When a sweep cycle starts.
"""
self.com.write(
f":trigger{trigger}"
+ (f":channel{channel}" if channel else "")
+ f":output {mode}"
)
def output_channel_state(self, output, channel, state):
self.com.write(
f":output{output}"
+ (f":channel{channel}" if channel else "")
+ f':state {"ON" if state else "OFF"}'
)
|
autosweep/autosweep/instruments/optical/Keysight8164B.py/0
|
{
"file_path": "autosweep/autosweep/instruments/optical/Keysight8164B.py",
"repo_id": "autosweep",
"token_count": 1897
}
| 1
|
import logging
from autosweep.utils.params import logger_format, logger_level
from autosweep.utils.typing_ext import PathLike
def init_logger(path: PathLike | None = None) -> logging.Logger:
"""
Used to configure the logging package for use inside this package. Can be used with other scripts as well.
:param path: The path to the logging output file to append messages to.
:type path: str or pathlib.Path, optional
:return: The root logger, a shortcut if you need it
:rtype: logging.Logger
"""
root_logger = logging.getLogger()
root_logger.setLevel(level=logger_level)
handlers = [logging.StreamHandler()]
if path:
handlers.append(logging.FileHandler(path))
root_logger.handlers = []
for handler in handlers:
formatter = logging.Formatter(logger_format)
handler.setFormatter(formatter)
handler.setLevel(logger_level)
root_logger.addHandler(handler)
return root_logger
|
autosweep/autosweep/utils/logger.py/0
|
{
"file_path": "autosweep/autosweep/utils/logger.py",
"repo_id": "autosweep",
"token_count": 339
}
| 2
|
import logging
import pathlib
from autosweep.data_types.metadata import PN, SN, DUTInfo, TimeStamp
from autosweep.data_types.recipe import Recipe
from autosweep.utils.logger import init_logger
def test_types():
init_logger()
pn = PN(num="ABC-12345", rev="123")
logging.info(f"{pn = }")
logging.info(f"{pn.part_num}")
logging.info(f"{str(pn)}")
sn = SN(num="123-12314")
logging.info(f"{sn = }")
logging.info(f"{sn.ser_num}")
logging.info(f"{str(sn)}")
dut = DUTInfo(part_num=pn, ser_num=sn, a="b", c="d")
logging.info(f"{dut = }")
logging.info(f"{dut.ser_num}")
logging.info(f"{str(dut)}")
ts = TimeStamp()
logging.info(f"{ts = }")
logging.info(f"{ts}")
ts1 = TimeStamp(timestamp=ts)
logging.info(f"{ts1 = }")
logging.info(f"{ts1}")
assert ts1 == ts, "Timestamps should match"
dirpath = pathlib.Path(__file__).parent.absolute()
r = Recipe.read_json(dirpath / "recipe.json")
r.to_json("recipe_2.json")
for n, t in r.tests():
logging.info(f"{n}: {t}")
r2 = Recipe.read_json(dirpath / "recipe_2.json")
assert r == r2, "Recipes should match"
if __name__ == "__main__":
test_types()
|
autosweep/tests/data_types/test_types.py/0
|
{
"file_path": "autosweep/tests/data_types/test_types.py",
"repo_id": "autosweep",
"token_count": 549
}
| 3
|
# Table of contents
# Learn more at https://jterbook.org/customize/toc.html
format: jb-book
root: index
parts:
- caption: Introduction
chapters:
- file: notebooks/10_layout.ipynb
- file: notebooks/10_layout_full.ipynb
- file: notebooks/11_drc.ipynb
- file: notebooks/20_modesolver_fem.ipynb
- file: notebooks/21_modesolver_fdfd.ipynb
- file: notebooks/22_heater_fem.ipynb
- file: notebooks/30_mzi.ipynb
- file: notebooks/31_ring.ipynb
- caption: Reference
chapters:
- url: https://gdsfactory.github.io/gplugins/
title: Plugins
- url: https://gdsfactory.github.io/gdsfactory
title: gdsfactory
|
gdsfactory-photonics-training/docs/_toc.yml/0
|
{
"file_path": "gdsfactory-photonics-training/docs/_toc.yml",
"repo_id": "gdsfactory-photonics-training",
"token_count": 299
}
| 4
|
plot_modes: false
resolution: 10
compute_time_seconds: 328.1761336326599
compute_time_minutes: 5.4696022272109985
|
gdsfactory-test-data/sp/bend_euler_5689b551_f3e429c3.yml/0
|
{
"file_path": "gdsfactory-test-data/sp/bend_euler_5689b551_f3e429c3.yml",
"repo_id": "gdsfactory-test-data",
"token_count": 44
}
| 5
|
resolution: 30
port_symmetries:
o1@0,o1@0:
- o2@0,o2@0
o2@0,o1@0:
- o1@0,o2@0
wavelength_start: 1.5
wavelength_stop: 1.6
wavelength_points: 50
port_margin: 2
port_monitor_offset: -0.1
port_source_offset: -0.1
dispersive: false
ymargin_top: 0.0
ymargin_bot: 3.0
xmargin_left: 0
xmargin_right: 3.0
layer_stack:
core:
layer:
- 1
- 0
thickness: 0.22
zmin: 0.0
material: si
sidewall_angle: 0
clad:
layer:
- 111
- 0
thickness: 3.0
zmin: 0.0
material: sio2
sidewall_angle: 0
slab150:
layer:
- 2
- 0
thickness: 0.15
zmin: 0.0
material: si
sidewall_angle: 0
slab90:
layer:
- 3
- 0
thickness: 0.09
zmin: 0.0
material: si
sidewall_angle: 0
nitride:
layer:
- 34
- 0
thickness: 0.35000000000000003
zmin: 0.32
material: sin
sidewall_angle: 0
ge:
layer:
- 5
- 0
thickness: 0.5
zmin: 0.22
material: ge
sidewall_angle: 0
via_contact:
layer:
- 40
- 0
thickness: 1.01
zmin: 0.09
material: Aluminum
sidewall_angle: 0
metal1:
layer:
- 41
- 0
thickness: 0.7000000000000001
zmin: 1.1
material: Aluminum
sidewall_angle: 0
heater:
layer:
- 47
- 0
thickness: 0.75
zmin: 1.1
material: TiN
sidewall_angle: 0
via1:
layer:
- 44
- 0
thickness: 0.49999999999999956
zmin: 1.8000000000000003
material: Aluminum
sidewall_angle: 0
metal2:
layer:
- 45
- 0
thickness: 0.7000000000000001
zmin: 2.3
material: Aluminum
sidewall_angle: 0
via2:
layer:
- 43
- 0
thickness: 0.20000000000000018
zmin: 3.0
material: Aluminum
sidewall_angle: 0
metal3:
layer:
- 49
- 0
thickness: 2.0
zmin: 3.2
material: Aluminum
sidewall_angle: 0
component:
name: bend_euler_radius3
settings:
name: bend_euler_radius3
module: gdsfactory.components.bend_euler
function_name: bend_euler
info:
length: 4.991
dy: 3.0
radius_min: 2.118
radius: 3.0
width: 0.5
info_version: 2
full:
angle: 90.0
p: 0.5
with_arc_floorplan: true
npoints: 720
direction: ccw
with_bbox: true
cross_section: strip
radius: 3
changed:
radius: 3
default:
angle: 90.0
p: 0.5
with_arc_floorplan: true
npoints: 720
direction: ccw
with_bbox: true
cross_section: strip
child: null
compute_time_seconds: 133.25350856781006
compute_time_minutes: 2.220891809463501
|
gdsfactory-test-data/sp/bend_euler_radius3_aaceb38e.yml/0
|
{
"file_path": "gdsfactory-test-data/sp/bend_euler_radius3_aaceb38e.yml",
"repo_id": "gdsfactory-test-data",
"token_count": 1317
}
| 6
|
"[\"E0\",\"\"]\n[\"E1\",\"\"]\n[\"W0\",\"\"]\n[\"W1\",\"\"]\n(\"W0\",\"mode 1\",1,\"W0\",1,\"transmi(...TRUNCATED)
|
gdsfactory-test-data/sp/coupler/coupler_G224n_L20_S220.dat/0
| {"file_path":"gdsfactory-test-data/sp/coupler/coupler_G224n_L20_S220.dat","repo_id":"gdsfactory-test(...TRUNCATED)
| 7
|
"simulation_settings:\n background_material: sio2\n port_margin: 1.5\n port_extension: 2.0\n mes(...TRUNCATED)
|
gdsfactory-test-data/sp/mmi1x2_mesh_accuracy1_si220n_w_dc021729.yml/0
| {"file_path":"gdsfactory-test-data/sp/mmi1x2_mesh_accuracy1_si220n_w_dc021729.yml","repo_id":"gdsfac(...TRUNCATED)
| 8
|
is_3d: false
compute_time_seconds: 34.20280599594116
compute_time_minutes: 0.5700467665990193
|
gdsfactory-test-data/sp/straight_46b2e15a.yml/0
| {"file_path":"gdsfactory-test-data/sp/straight_46b2e15a.yml","repo_id":"gdsfactory-test-data","token(...TRUNCATED)
| 9
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 3