Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyangkang committed Sep 20, 2023
1 parent b6f6a36 commit 1781e6b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 29 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ jobs:
# PDF. Note, this should be the same directory as the input
# paper.md
path: paper/md_paper/paper.pdf
- name: save pdf to repo
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Saved new PDF of paper
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ stemflow/*/__pycache__/*
stemflow/__pycache__/*
*.DS_Store
*.docx
./paper/references
*/references/*
2 changes: 0 additions & 2 deletions paper/md_paper/paper.bib
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


@article{fink_adaptive_2013,
title = {Adaptive {Spatio}-{Temporal} {Exploratory} {Models}: {Hemisphere}-wide species distributions from massively crowdsourced {eBird} data},
volume = {27},
Expand Down
4 changes: 3 additions & 1 deletion paper/md_paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ authors:
surname: Gu
orchid:
affiliation: "1, 3"

- given-names: Xiangjiang
surname: Zhan
corresponding: true
Expand All @@ -26,10 +25,13 @@ authors:
affiliations:
- name: Key Laboratory of Animal Ecology and Conservation Biology, Institute of Zoology, Chinese Academy of Sciences, Beijing, China
index: 1

- name: University of Chinese Academy of Sciences, Beijing, China
index: 2

- name: Cardiff University-Institute of Zoology Joint Laboratory for Biocomplexity Research, Chinese Academy of Sciences, Beijing, China
index: 3

- name: Center for Excellence in Animal Evolution and Genetics, Chinese Academy of Sciences, Kunming, China
index: 4

Expand Down
8 changes: 4 additions & 4 deletions stemflow/utils/plot_gif.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def make_sample_gif(data: pd.core.frame.DataFrame,
grid:
Whether to add grids.
lng_size:
pixel count to aggregate at longitudinal direction. Larger means finner resolution.
pixel count to aggregate at longitudinal direction. Larger means finer resolution.
lat_size:
pixel count to aggregate at latitudinal direction. Larger means finner resolution.
pixel count to aggregate at latitudinal direction. Larger means finer resolution.
xtick_interval:
the size of x tick interval.
ytick_interval:
the size of y tick interval.
log_scale:
log transfrom the target value or not.
log transform the target value or not.
dpi:
dpi of the GIF.
fps:
Expand Down Expand Up @@ -185,7 +185,7 @@ def make_sample_gif_scatter(data: pandas.core.frame.DataFrame,
grid:
Whether to add grids.
log_scale:
log transfrom the target value or not.
log transform the target value or not.
s:
size of the scatter.
dpi:
Expand Down
40 changes: 20 additions & 20 deletions stemflow/utils/quadtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def recursive_subdivide(node: Node,
grid_len_lat_upper_threshold: Union[float, int],
grid_len_lat_lower_threshold: Union[float, int],
points_lower_threshold: Union[float, int]):
"""recursively subdevide the grids
"""recursively subdivide the grids
Args:
node:
Expand Down Expand Up @@ -126,7 +126,7 @@ def contains(x, y, w, h, points):


def find_children(node):
"""return children nodeds of this node"""
"""return children nodes of this node"""
if not node.children:
return [node]
else:
Expand Down Expand Up @@ -161,15 +161,15 @@ def __init__(self,
grid_len_lat_lower_threshold:
stop divide if grid latitude **will** be below than the threshold
points_lower_threshold:
stop devide if points count is less than this threshold.
stop divide if points count is less than this threshold.
lon_lat_equal_grid:
whether to split the longtiude and latitude equally.
whether to split the longitude and latitude equally.
rotation_angle:
rangles to rotate the gridding.
angles to rotate the gridding.
calibration_point_x_jitter:
jitting the gridding on longitude.
jittering the gridding on longitude.
calibration_point_y_jitter:
jitting the gridding on latitude.
jittering the gridding on latitude.
Example:
```py
Expand All @@ -183,7 +183,7 @@ def __init__(self,
calibration_point_x_jitter = 10,
calibration_point_y_jitter = 10)
>> QT_obj.add_lon_lat_data(sub_data.index, sub_data['longitude'].values, sub_data['latitude'].values)
>> QT_obj.generate_griding_params()
>> QT_obj.generate_gridding_params()
>> QT_obj.subdivide() ## Call subdivide to process
>> gridding_info = QT_obj.get_final_result() # gridding_info is a dataframe
```
Expand Down Expand Up @@ -216,7 +216,7 @@ def add_lon_lat_data(self,
"""
if not len(x_array) == len(y_array) or not len(x_array) == len(indexes):
raise ValueError("input longitude and latitute and indexes not in same length!")
raise ValueError("input longitude and latitude and indexes not in same length!")

data = np.array([x_array, y_array]).T
angle = self.rotation_angle
Expand All @@ -235,8 +235,8 @@ def add_lon_lat_data(self,



def generate_griding_params(self):
"""generate the griding params after data are added
def generate_gridding_params(self):
"""generate the gridding params after data are added
Raises:
ValueError: self.lon_lat_equal_grid is not a bool
Expand Down Expand Up @@ -268,7 +268,7 @@ def get_points(self):
return self.points

def subdivide(self):
"""start recursively subdevide"""
"""start recursively subdivide"""
recursive_subdivide(self.root, self.grid_len_lon_upper_threshold, self.grid_len_lon_lower_threshold,
self.grid_len_lat_upper_threshold, self.grid_len_lat_lower_threshold,
self.points_lower_threshold)
Expand Down Expand Up @@ -419,7 +419,7 @@ def get_ensemble_quadtree(data: pandas.core.frame.DataFrame,
temporal_start: Union[float, int] = 1, temporal_end: Union[float, int]=366,
temporal_step: Union[float, int]=20, temporal_bin_interval: Union[float, int]=50,
temporal_bin_start_jitter: Union[float, int, str]= 'random',
spatio_bin_jitter_maginitude: Union[float, int] = 10,
spatio_bin_jitter_magnitude: Union[float, int] = 10,
save_gridding_plot: bool=True,
njobs: int=1,
verbosity: int=1,
Expand Down Expand Up @@ -463,16 +463,16 @@ def get_ensemble_quadtree(data: pandas.core.frame.DataFrame,
jitter of the start of the sliding window.
If 'random', a random jitter of range (-bin_interval, 0) will be generated
for the start.
spatio_bin_jitter_maginitude:
spatio_bin_jitter_magnitude:
jitter of the spatial gridding.
save_gridding_plot:
Whether ot save gridding plots
njobs:
Multi-processes count.
plot_xlims:
If save_gridding_plot=Ture, what is the xlims of the plot
If save_gridding_plot=True, what is the xlims of the plot
plot_ylims:
If save_gridding_plot=Ture, what is the ylims of the plot
If save_gridding_plot=True, what is the ylims of the plot
save_path:
If not '', save the ensemble dataframe to this path
Expand All @@ -495,10 +495,10 @@ def get_ensemble_quadtree(data: pandas.core.frame.DataFrame,

for ensemble_count in iter_func_:
rotation_angle = np.random.uniform(0,360)
calibration_point_x_jitter = np.random.uniform(-spatio_bin_jitter_maginitude, spatio_bin_jitter_maginitude)
calibration_point_y_jitter = np.random.uniform(-spatio_bin_jitter_maginitude, spatio_bin_jitter_maginitude)
calibration_point_x_jitter = np.random.uniform(-spatio_bin_jitter_magnitude, spatio_bin_jitter_magnitude)
calibration_point_y_jitter = np.random.uniform(-spatio_bin_jitter_magnitude, spatio_bin_jitter_magnitude)

# print(f'ensembel_count: {ensemble_count}')
# print(f'ensemble_count: {ensemble_count}')

temporal_bins = generate_temporal_bins(start = temporal_start,
end=temporal_end,
Expand Down Expand Up @@ -528,7 +528,7 @@ def get_ensemble_quadtree(data: pandas.core.frame.DataFrame,
## You need to generate the splitting parameters once giving the data. Like the calibration point and min,max.

QT_obj.add_lon_lat_data(sub_data.index, sub_data[Spatio1].values, sub_data[Spatio2].values)
QT_obj.generate_griding_params()
QT_obj.generate_gridding_params()

## Call subdivide to precess
QT_obj.subdivide()
Expand Down
2 changes: 1 addition & 1 deletion stemflow/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.24'
__version__ = '0.0.25'

0 comments on commit 1781e6b

Please sign in to comment.