Skip to content

Commit

Permalink
add 400 research papers ...3.pkl
Browse files Browse the repository at this point in the history
  • Loading branch information
subratamondal1 committed Mar 13, 2024
1 parent fde93eb commit f934417
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
20 changes: 19 additions & 1 deletion frontend/react-app/src/pages/UserProfile.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
import { useNavigate } from "react-router-dom";

const useLogout = () => {
const navigate = useNavigate();

const handleLogout = async () => {
localStorage.removeItem("appToken");
navigate("/login");
};

return handleLogout;
};

function UserProfile() {
const handleLogout = useLogout();
return (
<div className="flex justify-center items-center h-[100vh] bg-gradient-to-tr from-slate-50 to-blue-100">
<div className="bg-slate-50 shadow-md rounded-lg p-4">
Expand Down Expand Up @@ -67,7 +81,11 @@ function UserProfile() {
</div>
</div>
<div className="flex justify-center items-center">
<button className="px-4 py-2 bg-black text-white font-bold rounded-full">Logout</button>
<button
onClick={handleLogout}
className="px-4 py-2 bg-black text-white font-bold rounded-full">
Logout
</button>
</div>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/logics/data_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def get_results(

def store_data(
self,
save_file_name: str = "master_data.pkl",
max_results: int = 10,
days: int = 60,
save_file_name: str = "master_data3.pkl",
max_results: int = 500,
days: int = 365*2,
) -> None:
# Call the get_results method and store the dataframe in the self.extracted_data attribute
self.extracted_data = self.get_results(max_results, days)
Expand Down Expand Up @@ -165,15 +165,15 @@ def get_stored_data(self) -> pd.DataFrame:
type=str,
help="Maximum results to store",
nargs="?",
default=50,
default=500,
)
parser.add_argument(
"-d",
"--days",
type=str,
help="Store only for these many past days",
nargs="?",
default=50,
default=365*2,
)

# Parse the arguments
Expand Down
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pandas as pd
df = pd.read_json("./data/master_data.json")
df = pd.read_pickle("data/master_data3.pkl")
print(df.shape)
print(df.title.tail(20).iloc[5])
print(df.head(20))

0 comments on commit f934417

Please sign in to comment.