Skip to content

Commit

Permalink
chore: directory path cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
4bdul4ziz committed Sep 5, 2023
1 parent 404341a commit c8ac222
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion agri.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

# Define the path to the folder where the screenshots are moved
folder_path = os.path.expanduser("/Users/aman/AgriVision/working images")
folder_path = os.path.expanduser("images")

# Loop through all files in the folder
for filename in os.listdir(folder_path):
Expand Down
14 changes: 7 additions & 7 deletions finale.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ library(reticulate)
library(png)

# Activate the Python environment
use_python("/Library/Frameworks/Python.framework/Versions/3.11/bin/python3")
use_python("~/miniconda3/envs/r-reticulate/bin/python")

# Define the paths to the Python scripts
map_path <- "map.py"
Expand Down Expand Up @@ -131,9 +131,9 @@ server <- function(input, output) {
#to show location details
output$Location_output <- renderText({

if (file.size("/Users/aman/AgriVision/media/location.txt")>0){
if (file.size("media/location.txt")>0){

Location_file_read <- read.delim("/Users/aman/AgriVision/media/location.txt", header = TRUE, sep = "\n") # nolint
Location_file_read <- read.delim("media/location.txt", header = TRUE, sep = "\n") # nolint

paste(toString(Location_file_read))
}
Expand All @@ -142,9 +142,9 @@ server <- function(input, output) {
#to show climate attributes
output$Attributes_output <- renderText({

if (file.size("/Users/aman/AgriVision/media/attributes.txt")>0){
if (file.size("media/attributes.txt")>0){

Attribute_file_read <- read.delim("/Users/aman/AgriVision/media/attributes.txt", header = TRUE, sep = "\n") # nolint
Attribute_file_read <- read.delim("media/attributes.txt", header = TRUE, sep = "\n") # nolint

paste(toString(Attribute_file_read))
}
Expand Down Expand Up @@ -174,11 +174,11 @@ server <- function(input, output) {

observeEvent(input$clear_images, {
# Get a list of all the files in the directory
files <- list.files("/Users/aman/AgriVision/working images")
files <- list.files("working images")

# Remove each file one by one
for (file in files) {
file.remove(paste0("/Users/aman/AgriVision/working images", file))
file.remove(paste0("working images", file))
}

# Clear the image plots
Expand Down
2 changes: 1 addition & 1 deletion migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Define the source and destination paths
desktop_path = os.path.expanduser("~/Desktop")
destination_path = os.path.expanduser("/Users/aman/AgriVision/working images")
destination_path = os.path.expanduser("images")

# Create the destination folder if it doesn't exist
if not os.path.exists(destination_path):
Expand Down
4 changes: 2 additions & 2 deletions panchromatic-sharpening.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
"# read m and p data\n",
"IM_ID = '6120_2_2'\n",
"\n",
"m = tiff.imread('/Users/aman/Downloads/sixteen_band/6120_2_2_M.tif')\n",
"pan = tiff.imread('/Users/aman/Downloads/sixteen_band/6120_2_2_P.tif')\n",
"m = tiff.imread('sixteen_band/6120_2_2_M.tif')\n",
"pan = tiff.imread('sixteen_band/6120_2_2_P.tif')\n",
"\n",
"\n",
"\n",
Expand Down

0 comments on commit c8ac222

Please sign in to comment.