Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5aaf2ef

Browse files
author
Montana Low
committed
remove parens around ifs
1 parentf61cc0b commit5aaf2ef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎pgml/pgml/model.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def find(cls, id: int):
4141
FROM pgml.projects
4242
WHERE id ={q(id)}
4343
""",1)
44-
if(len(result)==0):
44+
iflen(result)==0:
4545
returnNone
4646

4747
project=Project()
@@ -71,7 +71,7 @@ def find_by_name(cls, name: str):
7171
FROM pgml.projects
7272
WHERE name ={q(name)}
7373
""",1)
74-
if(len(result)==0):
74+
iflen(result)==0:
7575
returnNone
7676

7777
project=Project()
@@ -203,10 +203,10 @@ def data(self):
203203
y.append(y_)
204204

205205
# Split into training and test sets
206-
if(self.test_sampling=='random'):
206+
ifself.test_sampling=='random':
207207
returntrain_test_split(X,y,test_size=self.test_size,random_state=0)
208208
else:
209-
if(self.test_sampling=='first'):
209+
ifself.test_sampling=='first':
210210
X.reverse()
211211
y.reverse()
212212
ifisinstance(split,float):
@@ -273,7 +273,7 @@ def find_deployed(cls, project_id: int):
273273
ORDER by deployments.created_at DESC
274274
LIMIT 1
275275
""")
276-
if(len(result)==0):
276+
iflen(result)==0:
277277
returnNone
278278

279279
model=Model()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp