Skip to content

Commit

Permalink
unused imports, black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
jakevc committed Feb 20, 2024
1 parent 7d340e7 commit 2df4396
Show file tree
Hide file tree
Showing 10 changed files with 1,270 additions and 755 deletions.
Binary file added .pymon
Binary file not shown.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
}
4 changes: 2 additions & 2 deletions fibermorph/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

import importlib.metadata
__version__= importlib.metadata.version('fibermorph')

__version__ = importlib.metadata.version("fibermorph")
27 changes: 12 additions & 15 deletions fibermorph/arc_sim.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# %% Imports
import sympy

from PIL import Image, ImageDraw
import random
from random import randint
import pathlib
from sklearn import preprocessing

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -42,15 +41,16 @@

# function to generate arc given the start and end angles


def apoints(row):
stheta = row[1]
etheta = row[2]
rthetas = np.linspace(start=stheta, stop=etheta, num=25)
x = pd.Series(radius * np.cos(rthetas), name="x")
y = pd.Series(radius * np.sin(rthetas), name="y")

dat2 = pd.concat([x, y], axis=1)

return dat2


Expand All @@ -64,21 +64,18 @@ def apoints(row):
def center_func(coord_df):
x = coord_df["x"]
y = coord_df["y"]

x2 = pd.Series(x - np.mean(x), name="x2")
y2 = pd.Series(y - np.mean(y), name="y2")

dat3 = pd.concat([x2, y2], axis=1)

return dat3


dats["c_coords"] = dats["coords"].apply(lambda row: center_func(row))

from sklearn import preprocessing


im = Image.new('L', (xlims, ylims), color="white")
im = Image.new("L", (xlims, ylims), color="white")
draw = ImageDraw.Draw(im)

coord_list = np.array(dats["c_coords"].iloc[0])
Expand All @@ -96,17 +93,17 @@ def center_func(coord_df):
# another function to center arcs to the middle of the window but by scaling
def center_python_func(coord_df):
scaler = preprocessing.MinMaxScaler(feature_range=(0, 200))

dat4 = coord_df
dat4["x"] = scaler.fit_transform(coord_df[["x"]])
dat4["y"] = scaler.fit_transform(coord_df[["y"]])

return dat4


dats["c_coords"] = dats["coords"].apply(lambda row: center_python_func(row))

im = Image.new('L', (xlims, ylims), color="white")
im = Image.new("L", (xlims, ylims), color="white")
draw = ImageDraw.Draw(im)

coord_list = np.array(dats["c_coords"].iloc[0])
Expand Down
Loading

0 comments on commit 2df4396

Please sign in to comment.