-
Notifications
You must be signed in to change notification settings - Fork 42
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
Introduced RF material library to microwave plugins #1756
Conversation
48ce8a2
to
efb64b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Qiming, this looks great! Two main comments:
- A material can contain several variants. E.g. there can be several difference types of FR4 depending on the data source. Will be good to still follow this format?
- It would be better to define those Abstract classes in tidy3d rather than in plugin. In that case, both RF material library and photonics material library items can subclass from them. This helps reduce redundant codes.
tidy3d/__init__.py
Outdated
@@ -256,6 +256,7 @@ | |||
# get material `mat` and variant `var` as `material_library[mat][var]` | |||
from .material_library.material_library import material_library | |||
from .material_library.parametric_materials import Graphene | |||
from .plugins.microwave.rf_material_library import rf_material_library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to expose it to tidy3d namespace. Instead, add it to plugins/microwave/__init__.py
efb64b2
to
e087f09
Compare
Exactly, I will follow the optical library to include these variants, including the "design" and "process" variants we've discussed for the Rogers laminates.
Sounds good, I will handle it properly. |
I introduced variants to the materials. Now, the RF materials follow a similar structure to the optical ones. from tidy3d import rf_material_library
Rogers3010 = rf_material_library['Rogers3010']['design']
print(Rogers3010) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are lots of formatting going on. Which ruff
version are you using?
(also temporarily change the merge branch to |
The formatting here makes no different to |
@yaugenst recently updated the notion guide here for that. I think just |
Also, recommend installing the pre-commit hooks to get this to happen automatically. I only recently installed it and it saves me a lot of time now |
When running |
Yeah, I used both |
hm, I'm sorry, I actually haven't 100% figured out the best option. For me the pre-commit has been working well, without GitHub CI complaining, so maybe try installing that? |
My understanding is that I guess just revert all formatting in this PR? |
Hey all! The correct notion page is this one: https://www.notion.so/flexcompute/Tidy3D-Developer-Guide-23ceee49660e42fca06484bfcaa96b5c?pvs=4 I think everyone has access to that. Regarding ruff: Everything on develop was formatted using ruff 0.4.8 - this is also pinned as a dependency, and is what the pre-commit hook uses. If you use anything else, i.e. older ruff versions or black, the formatting will be different and it will not pass in CI. In general it's a good idea to keep a dev environment for each branch, and keep it up to date with the poetry lock file on that branch. I think @daquinteroflex set up the poetry packaging and wrote a guide on how to set up the env here. Currently it's probably a bit confusing still how to set everything up, we should write a simple guide for this and communicate it to everyone... |
f1d9cfe
to
31088ab
Compare
Hello! Yeah, agree with Yannick on what he mentions. We should make a simpler version that is more straightforward and the one you've written on notion looks great! So yes, the idea of using the poetry environments guarantees we'll all have the same dependencies across our computers between PRs. Because it changed in the latest ruff update, that's why this formatting in this PR is failing as it was an older version. The Happy to help you @QimingFlex if you need a hand too |
31088ab
to
4d5f3f8
Compare
0665f16
to
d77bd28
Compare
@weiliangjin2021 generated the documentation and placed it under the folder |
Also need to include this RST in index.rst etc. E.g. photonics material library appears also here and here. How to build it into a website locally can be found here. |
f58b3c9
to
8a0e380
Compare
9a9ff5d
to
4189528
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All look good to me. Just rebase to pre/2.8.
4189528
to
e01a006
Compare
e01a006
to
0d13483
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @QimingFlex ! Just a couple comments from me. Overall looks good!
CHANGELOG.md
Outdated
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
|||
### Added | |||
- Users can now export `SimulationData` to MATLAB `.mat` files with the `to_mat_file` method. | |||
- Introduce RF material library including several commonly used RF PCB materials. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to mention where users can import this from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
@@ -227,8 +228,177 @@ def num2str(num): | |||
f.write("\n") | |||
|
|||
|
|||
def generate_rf_material_library_doc(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this mostly copied from the genereate_material_library_doc
? can we write in a way that we dont need to re-implement this in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, mostly from generate_material_library_doc. I'll keep this in mind and reduce the redundancy later.
0d13483
to
6294152
Compare
Hey @weiliangjin2021 , I mirrored the optical material library to create an RF microwave material library and included three materials as examples. Could you please provide some feedback so I can refine the format of the RF material library?
Example:
from tidy3d import rf_material_library FR4 = rf_material_library['FR4'] print(FR4.medium)