Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Dec 13, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from adophobr December 13, 2023 18:15
Comment on lines -176 to +189
Copy link
Author

Choose a reason for hiding this comment

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

Function genConst refactored with the following changes:

Comment on lines -157 to +161
Copy link
Author

Choose a reason for hiding this comment

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

Lines 157-161 refactored with the following changes:

Comment on lines -301 to +309

U = Matrix([[1, 0, 0, 0],
[0, 0, 1, 0],
[0, 1, 0, 0],
[0, 0, 0, j]])

Ei = Matrix([[E1],[0],[0],[E2]]) # vetor 4x1

Eo = M*U*M*Ei

return Eo

return M*U*M*Ei
Copy link
Author

Choose a reason for hiding this comment

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

Function hybrid_2x4_90 refactored with the following changes:

Comment on lines -409 to +417

# optical hybrid transfer matrix
T = np.array([[ 1/2, 1j/2, 1j/2, -1/2],
[ 1j/2, -1/2, 1/2, 1j/2],
[ 1j/2, 1/2, -1j/2, -1/2],
[-1/2, 1j/2, -1/2, 1j/2]])

Ei = np.array([E1, np.zeros((E1.size,)),
np.zeros((E1.size,)), E2])

Eo = T@Ei

return Eo

return T@Ei
Copy link
Author

Choose a reason for hiding this comment

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

Function hybrid_2x4_90deg refactored with the following changes:

Comment on lines -73 to +94

c = 299792458 # speed of light (vacuum)
c_kms = c/1e3
λ = c_kms/Fc
α = alpha/(10*np.log10(np.exp(1)))
β2 = -(D*λ**2)/(2*np.pi*c_kms)
γ = gamma

Nfft = len(Ex)

ω = 2*np.pi*Fs*fftfreq(Nfft)

Nspans = int(np.floor(Ltotal/Lspan))
Nsteps = int(np.floor(Lspan/hz))

Ex = fft(Ex) #Pol. X
Ey = fft(Ey) #Pol. Y

linOperator = np.exp(-(α/2)*(hz/2) + 1j*(β2/2)*(ω**2)*(hz/2))

for spanN in tqdm(range(1, Nspans+1)):
for stepN in range(1, Nsteps+1):


for _ in tqdm(range(1, Nspans+1)):
for _ in range(1, Nsteps+1):
Copy link
Author

Choose a reason for hiding this comment

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

Function manakovSSF refactored with the following changes:

Comment on lines -210 to +209
bits_x = np.random.randint(2, size=3*2**14)
bits_x = np.random.randint(2, size=3*2**14)
Copy link
Author

Choose a reason for hiding this comment

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

Lines 210-323 refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant