-
Notifications
You must be signed in to change notification settings - Fork 2
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
Jsl/make layer stack v2 #79
Conversation
On second thought, maybe a better method to support multiple adjacent prepreg layers is:
rather than what I have in the last commit: 'Enhance make-layer-stack ...'
|
I would prefer that we consider the following:
Because they we can add a function like:
And this ends up looking more like:
This was we can prevent the introduction of touching copper layers by design and we can support multiple pre-preg layers as necessary. |
For the case when there are even number of layers (no one center layer), perhaps we can support it this way:
To use But then, maybe it is better to just use an optional flag [Edit] Strike above comment. |
The
and
|
…], rather than error out. Add test when there are multiple prepreg layers in the middle
] | ||
``` | ||
|
||
Example 3: 6-layer stack with even number of layers, such as "JLC06201H-3313A" |
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.
For examples 1, 2, 3 - let's please use the @snippet
marker and related @snip-note
marker syntax here for the docstrings.
See here for more details:
https://jit-x.slack.com/docs/TKJEB34LS/F05RW135Y0J
|
||
Example 3: 6-layer stack with even number of layers, such as "JLC06201H-3313A" | ||
``` | ||
make-layer-stack("6-layer stack with even number of layers", outers, even-layers? = true) where : |
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.
Why would we do this ?
Why would we not just continue using the pattern we have already established?
For example:
val outers =
[
[copper-35um prepreg]
[copper-17_5um core]
[copper-17_5um [prepreg2, prepreg2]] ; => two layers of prepreg2 in the center
]
I would much prefer this than even-layers?
which is difficult to explain and requires additional handling.
add-top(reverse(layers), stack) ; ordered from inner to outer | ||
add-bottom(reverse(layers), stack) | ||
else : ; even-layers? = true | ||
if outer[1] is LayerSpec : |
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.
Can we please use a match
statement instead of using if ... is
?
The if ... is
is an anti-pattern in stanza and the idiomatic mechanism is the match
clause.
if n-insuls == 1 : ; [copper [dielectric]] => treat it as [copper dielectric] | ||
add-symmetric(metal, insuls[0], stack) | ||
else : | ||
add-symmetric(insuls[n-insuls - 2], insuls[n-insuls - 1], stack) |
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.
This doesn't look right. What happens if n-insuls
is greater than 3 ?
;Verify input | ||
if outer[1] is Tuple<LayerSpec> and empty?(outer[1] as Tuple<LayerSpec>) : | ||
throw(Exception("Invalid argument: The tuple of dialectric layers is empty. Expect [LayerSpec Tuple<LayerSpec>]. Found %_" % [outer])) | ||
if not even-layers? : |
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.
The even-layers?
parameter here is making this function about 1000x more complicated than this needs to be.
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.
We need to remove this.
Please see the third version of I have incorporated changes to address the comments in this PR there too. |
Dropping this PR since the third version of |
and then re-commit it for review.
verify-layers
to handle even number of layers in a stack.In summary, the make-layer-stack is revised to support these two examples:
and