-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
109 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,3 +115,4 @@ dmypy.json | |
|
||
.idea/ | ||
*.DS_Store | ||
*/temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import numpy as np | ||
import pandas as pd | ||
import matplotlib.pyplot as plt | ||
from hkjournalist import Journalist | ||
|
||
config = {} | ||
|
||
|
||
def sin_2x_and_cos_2x(x): | ||
y = np.sin(x) * np.sin(x) + np.cos(x) * np.cos(x) | ||
return y | ||
|
||
|
||
x = np.arange(0, 4 * np.pi, 0.1) | ||
y1 = np.sin(x) | ||
y2 = np.cos(x) | ||
|
||
df = pd.DataFrame({'x': x, 'sin(x)': y1, 'cos(x)': y2}) | ||
df['sin^2^(x)+cos^2^(x)'] = sin_2x_and_cos_2x(df['x']).values | ||
df = df.set_index('x') | ||
|
||
# plot sine curve as sin_plot | ||
ax = df.plot() | ||
plt.tight_layout() | ||
config['sin_plot'] = ax | ||
|
||
# random select 5 point (x,y) as sin_table | ||
config['sin_table'] = df.sample(5) | ||
|
||
config['sin_func'] = sin_2x_and_cos_2x | ||
|
||
reporter = Journalist(template_file='./reports/3_zh_cn_template.md', zh=True) | ||
reporter.hear(config) | ||
reporter.report(output_file='./reports/3_zh_report.pdf', beamer=True, overwrite=True) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
documentclass: ctexbeamer | ||
title: 中文报告 | ||
author: 香港记者 | ||
date: \today{{}} | ||
--- | ||
|
||
### 正弦曲线 | ||
|
||
![]({sin_plot}) | ||
|
||
### 正弦取值 | ||
|
||
{sin_table} | ||
|
||
### 正弦函数 | ||
|
||
```{{.python}} | ||
{sin_func} | ||
``` | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setuptools.setup( | ||
name="hkjournalist", | ||
version="0.0.4", | ||
version="0.0.5", | ||
author="Xinyi", | ||
author_email="[email protected]", | ||
description="Custom Auto Report Generator for Python Program", | ||
|