Skip to content

Commit

Permalink
Merge pull request #1 from paudefuente/develop
Browse files Browse the repository at this point in the history
Release of BETA v0.1.0
  • Loading branch information
paudefuente authored Dec 26, 2024
2 parents 414297a + aa751dc commit 6c46806
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 217 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# research-mind
research-mind is a library with different scripts, utils, services and functions useful when doing research.


## Tools Used

- pipx -> Tool that enables the installation and execution of python applications in isolated environments.
- poetry -> Tool for dependency management and packaging in Python, allowing to to declare the libraries the project depends on and will manage (install / update) them automatically without involving a developer.
2 changes: 1 addition & 1 deletion core/search/query_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def separate_keyterms(self, concepts: pd.Series, keyterms: pd.Series,
basic_structure["data"].append(new_concept)

# Create or overwriter JSON file
path_file = f"{SearchService.JSON_FOLDER_PATH}/separated_keyterms.json"
path_file = f"{QueryGenerator.JSON_FOLDER_PATH}/separated_keyterms.json"
with open(path_file, "w") as file:
json.dump(basic_structure, file, indent=4)

Expand Down
2 changes: 1 addition & 1 deletion core/search/scrapper_googlescholar.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pandas as pd
from scholarly import scholarly as scho

from ..query_generator import SearchService
from query_generator import SearchService


class ScrapperService:
Expand Down
113 changes: 0 additions & 113 deletions docs/FILES.md
Original file line number Diff line number Diff line change
@@ -1,113 +0,0 @@
"""
Functionality created to clean all the files created by the LaTeX compiler. This function is called by the main function
in the main.py file, in which the user can choose to clean the files or not.

The function will take all the file extensions that defined in .gitignore file and ignored by the git, and will remove them
from the directory.
"""

import subprocess
import os
import fnmatch
import logging

# Configure logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)


# Constants
GIT_IGNORE_FILE_PATH = "./src/docs/paper/.gitignore"


# Functions
def clean_ignored_files(project_path: str, git_ignore_path: str):
"""
This function will remove all the files that are defined in the .gitignore file.

:param project_path: The path of the project.
:param git_ignore_path: The path of the .gitignore file.
:return: None
"""

try:

# Verify that the project path exists
if not os.path.exists(project_path):
raise FileNotFoundError(f"No se encontró el directorio {project_path}")
if not os.path.exists(git_ignore_path):
raise FileNotFoundError(f"No se encontró el archivo .gitignore en {git_ignore_path}")
# Get the patterns that are defined in the .gitignore file
patterns = get_gitignore_patterns(git_ignore_path)

# Iterate over the folder / files structure and remove the files that match the patterns
for root, dirs, files in os.walk(project_path):
for file in files:

file_path = os.path.join(root, file)
if any(fnmatch.fnmatch(file_path, os.path.join(project_path, pattern)) for pattern in patterns):

try:
os.remove(file_path)
print(f"File Deleted: {file_path}")
except Exception as e:
print(f"Not possible to delete the file {file_path}")
print(e)
except subprocess.CalledProcessError as e:
print(e)
except Exception as e:
print("Took place an unexpected error:")
print(e)
print("Took place an unexpected error:")
print(e)


def get_gitignore_patterns(gitignore_path: str):

"""
This function will read the .gitignore file and return the patterns that are defined in the file.

:param git_repo_path: The path of the git repository.
:return: The patterns that are defined in the .gitignore file.
"""
with open(gitignore_path, "r") as file:
patterns = [line.strip() for line in file if line.strip() and not line.startswith("#")]
return patterns


def get_current_directory():
"""
This function will return the current directory where the script is running.

:return: The current directory.
"""
return os.path.dirname(os.path.abspath(__file__))


def get_project_path():
"""
This function will return the path of the project.

:return: The path of the project.
"""
path = get_current_directory()
return os.path.join(get_current_directory(), "../../")


def main():
"""
Main function which will clean the files that are defined in the .gitignore file
searching in the project path.
"""
print("Cleaning the files that are defined in the .gitignore file.")
clean_ignored_files(get_project_path(), GIT_IGNORE_FILE_PATH)


# Execute the main function
if __name__ == "__main__":
main()
102 changes: 50 additions & 52 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,61 +1,59 @@

[build-system]
requires = [
"setuptools",
"wheel",

"setuptools",
"wheel"
]
buiild-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"

[tool.setuptools.build_meta]
requires = ["setuptools"]
[too.setuptools.packages.find]
where = ["core"]

[project]
name = "Resmind"
name = "resmind"
version = "0.1.0"
descripton = "Resmind is a library developed in response to the necesity of automating a range of processes associated with research across the field of computer science."
authors = [{user = "paudefuente", name = "Pau Fuente", email = "[email protected]"}]
description = "Resmind is a library developed in response to the necessity of automating a range of processes associated with research across the field of computer science."
authors = [
{ name = "paudefuente - Pau Fuente", email = "[email protected]" }
]
readme = "README.md"
license = "MIT"
required-python = ">=3.11"
license = { file = "LICENSE" }
requires-python = ">=3.11"
dependencies = [
"asttokens==2.4.1",
"certifi==2024.8.30",
"charset-normalizer==3.4.0",
"colorama==0.4.6",
"comm==0.2.2",
"debugpy==1.8.8",
"decorator==5.1.1",
"executing==2.1.0",
"idna==3.10",
"ipykernel==6.29.5",
"ipython==8.29.0",
"jedi==0.19.2",
"jupyter_client==8.6.3",
"jupyter_core==5.7.2",
"matplotlib-inline==0.1.7",
"nest-asyncio==1.6.0",
"numpy==2.1.3",
"packaging==24.2",
"pandas==2.2.3",
"parso==0.8.4",
"platformdirs==4.3.6",
"prompt_toolkit==3.0.48",
"psutil==6.1.0",
"pure_eval==0.2.3",
"Pygments==2.18.0",
"python-dateutil==2.9.0.post0",
"pytz==2024.2",
"pywin32==308",
"pyzmq==26.2.0",
"requests==2.32.3",
"six==1.16.0",
"stack-data==0.6.3",
"tornado==6.4.1",
"traitlets==5.14.3",
"tzdata==2024.2",
"urllib3==2.2.3",
"wcwidth==0.2.13",
"scholarly",
}

"certifi==2024.8.30",
"charset-normalizer==3.4.0",
"colorama==0.4.6",
"comm==0.2.2",
"debugpy==1.8.8",
"decorator==5.1.1",
"executing==2.1.0",
"idna==3.10",
"ipykernel==6.29.5",
"ipython==8.29.0",
"jedi==0.19.2",
"jupyter_client==8.6.3",
"jupyter_core==5.7.2",
"matplotlib-inline==0.1.7",
"nest-asyncio==1.6.0",
"numpy==2.1.3",
"packaging==24.2",
"pandas==2.2.3",
"parso==0.8.4",
"platformdirs==4.3.6",
"prompt_toolkit==3.0.48",
"psutil==6.1.0",
"pure_eval==0.2.3",
"Pygments==2.18.0",
"python-dateutil==2.9.0.post0",
"pytz==2024.2",
"pywin32==308",
"pyzmq==26.2.0",
"requests==2.32.3",
"six==1.16.0",
"stack-data==0.6.3",
"tornado==6.4.1",
"traitlets==5.14.3",
"tzdata==2024.2",
"urllib3==2.2.3",
"wcwidth==0.2.13",
"scholarly",
]
50 changes: 0 additions & 50 deletions setup.py

This file was deleted.

0 comments on commit 6c46806

Please sign in to comment.