Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcad scripts #382

Merged
merged 87 commits into from
Apr 17, 2024
Merged

tcad scripts #382

merged 87 commits into from
Apr 17, 2024

Conversation

simbilod
Copy link
Collaborator

@simbilod simbilod commented Apr 17, 2024

generic scripts to generate Sentaurus simulation command files from gdsfactory primitives

writes:

  • sde (process emulation)
  • sprocess (process simulation)
  • sdevice
  • svisual (to parse fields)

There is no execution of the simulation, this only helps with writing input files. There will be no tests. Comes as-is with no guarantees :)

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @simbilod - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 4 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 6 issues found
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +64 to +80
def cleanup_component_layermap(component, layermap, round_tol=2, simplify_tol=1e-2):
"""Process component polygons before processing.

Uses layermap (design layers) names.
"""
layer_dict = vars(layermap)

return {
layer: fuse_polygons(
component,
layername,
layer,
round_tol=round_tol,
simplify_tol=simplify_tol,
)
for layername, layer in layer_dict.items()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code_refinement): Consider renaming cleanup_component_layermap to reflect its specific functionality.

The function name could be more descriptive regarding its operation on layer maps specifically, which might help in distinguishing it from other cleanup functions.

Comment on lines +1 to +2
import math
import pathlib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (code_refinement): Review the necessity of importing pathlib directly if Path is already imported.

Since Path is imported from pathlib, ensure that the direct import of pathlib is necessary, or consider removing it if not used.

Comment on lines +1 to +2
import pathlib
from pathlib import Path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (code_refinement): Redundant import of pathlib when Path is used.

Consider removing the import of pathlib since Path is specifically imported and used.

@@ -0,0 +1,646 @@
import math
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Missing test cases for the initialize_sprocess function.

Please add unit tests to verify the correct initialization of the sprocess file, including checks for correct handling of default values and boundary conditions.

@@ -0,0 +1,646 @@
import math
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Missing test cases for the write_sprocess function.

Please ensure there are tests to validate the output of the write_sprocess function, including the correct generation of the command file and handling of different process steps.

@@ -0,0 +1,468 @@
import math
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Missing test cases for the initialize_sde function.

It's crucial to add tests that verify the geometry definitions and initial conditions set by the initialize_sde function are correct.

@@ -0,0 +1,468 @@
import math
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Missing test cases for the write_sde function.

Please add tests to ensure that the write_sde function correctly writes the Scheme file based on the provided component and process parameters.

@@ -0,0 +1,297 @@
import pathlib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Missing test cases for the write_sdevice_quasistationary_ramp_voltage_dd function.

Tests should verify that the function correctly sets up the device simulation with the specified ramp voltage parameters.

Suggested change
import pathlib
import unittest
class TestDeviceSimulation(unittest.TestCase):
def test_ramp_voltage_parameters(self):
expected_final_voltage = 1.0
ramp_voltage_simulation = write_sdevice_quasistationary_ramp_voltage_dd(ramp_final_voltage=expected_final_voltage)
self.assertEqual(ramp_voltage_simulation.ramp_final_voltage, expected_final_voltage)
if __name__ == '__main__':
unittest.main()

@@ -0,0 +1,297 @@
import pathlib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Missing test cases for the write_sdevice_ssac_ramp_voltage_dd function.

Ensure there are tests to check the correct setup of the SSAC ramp voltage simulation, including the handling of different contacts and voltage settings.

Suggested change
import pathlib
import unittest
class TestSSACRampVoltageSimulation(unittest.TestCase):
def test_correct_setup(self):
# Setup test environment
# Execute the simulation with different contacts and voltage settings
# Assert the expected outcomes
if __name__ == '__main__':
unittest.main()

Comment on lines +1 to +2
import math
import pathlib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (code_refinement): Check for potential redundancy in math and pathlib imports.

Verify if both math and pathlib are utilized within the module, or if any can be omitted to streamline the import statements.

@joamatab joamatab added the enhancement New feature or request label Apr 17, 2024
@joamatab joamatab self-requested a review April 17, 2024 15:03
@joamatab joamatab merged commit f1a19ed into gdsfactory:main Apr 17, 2024
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants