Skip to content
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

Remove deprecated functions #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions potato/flask_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,24 +880,6 @@ def cal_amount(user):
return count


def find_start_id(user):
"""
path = user_dict[user]["path"]
# if not os.path.exists(path):
# initialize_user_data(path, user_dict[user]['user_id'])
user_data = {}
user_dict[user]["start_id"] = len(all_data["annotated_data"])
lines = user_dict[user]["user_data"]
for i in range(len(lines), 0):
line = lines[str(i)]
if not line["annotated"]:
user_dict[user]["start_id"] = line["id"]
return line["id"]
# user_dict[user]['user_data'] = user_data
"""
raise RuntimeError("This function is deprecated?")


def move_to_prev_instance(username):
user_state = lookup_user_state(username)
user_state.go_back()
Expand Down Expand Up @@ -1017,49 +999,6 @@ def get_span_annotations_for_user_on(username, instance_id):
return span_annotations


# This was used to merge annotated instances in previous annotations. For
# example, you had some annotations from google sheet, and want to merge it with
# the current annotation procedure
def merge_annotation():
"""
global user_dict
global all_data
global args

with open("merged_annotation.json", "w") as w:
for i in range(len(all_data["annotated_data"])):
line = all_data["annotated_data"][i]
annotations = []
for user in user_dict:
if "label" in user_dict[user]["user_data"][str(i)]:
annotations.append(
{
"label": int(user_dict[user]["user_data"][str(i)]["label"]),
"user": int(user_dict[user]["user_id"]),
}
)
line["annotations"] = annotations
w.writelines(json.dumps(line) + "\n")
"""
raise RuntimeError("This function is deprecated?")


def write_data(username):
"""
global user_dict
# global closed
global all_data
global args

path = user_dict[username]["path"]
with open(path, "w") as w:
for line in user_dict[username]["user_data"]:
line = json.dumps(user_dict[username]["user_data"][line])
w.writelines(line + "\n")
"""
raise RuntimeError("This function is deprecated?")


@app.route("/")
def home():
global user_config
Expand Down