Skip to content

Commit

Permalink
fix_not_extra_dataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
o-murphy committed Dec 27, 2023
1 parent 8f4d4e9 commit 7ed8054
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 15 deletions.
80 changes: 68 additions & 12 deletions Example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"execution_count": 1,
"metadata": {
"pycharm": {
"is_executing": true
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [
Expand All @@ -32,7 +33,11 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
Expand All @@ -57,7 +62,11 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -96,7 +105,11 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
Expand All @@ -118,7 +131,11 @@
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -156,7 +173,11 @@
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"shot_result.dataframe.to_clipboard()"
Expand All @@ -169,6 +190,9 @@
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
Expand All @@ -181,6 +205,9 @@
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
Expand All @@ -193,6 +220,9 @@
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
Expand All @@ -205,6 +235,9 @@
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
Expand All @@ -217,6 +250,9 @@
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
Expand All @@ -225,35 +261,55 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
Expand All @@ -279,4 +335,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
177 changes: 177 additions & 0 deletions examples/canik_50bmg.ipynb

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions examples/canik_50bmg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from py_ballisticcalc import Unit
from py_ballisticcalc import DragModel, TableG1
from py_ballisticcalc import Ammo
from py_ballisticcalc import Weapon, Shot, Calculator
from py_ballisticcalc import Settings as Set

Set.Units.distance = Unit.METER
Set.Units.velocity = Unit.MPS
Set.Units.sight_height = Unit.CENTIMETER

dm = DragModel(0.62, TableG1, 661, 0.51)
ammo = Ammo(dm, 2.3, 837)

weapon = Weapon(9, 500, 15, Unit.DEGREE(30))
calc = Calculator(weapon, ammo)
zero_elevation = calc.elevation
print(f'Barrel elevation for zero: {zero_elevation << Unit.MIL}')

shot = Shot(3000, zero_angle=calc.elevation, relative_angle=Unit.MIL(0))
shot_result = calc.fire(shot, 100, extra_data=False)
shot_result.dataframe.to_clipboard()
2 changes: 1 addition & 1 deletion py_ballisticcalc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__copyright__ = ("",)

__credits__ = ["o-murphy"]
__version__ = "1.1.2"
__version__ = "1.1.3"


from .backend import *
Expand Down
2 changes: 1 addition & 1 deletion py_ballisticcalc/trajectory_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def dataframe(self):
""":return: the trajectory table as a DataFrame"""
if pd is None:
raise ImportError("Install pandas to get trajectory as dataframe")
self.__check_extra__()
# self.__check_extra__()
col_names = list(TrajectoryData._fields)
trajectory = [p.in_def_units() for p in self]
return pd.DataFrame(trajectory, columns=col_names)
Expand Down
2 changes: 1 addition & 1 deletion py_ballisticcalc_exts/py_ballisticcalc_exts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__copyright__ = ("",)

__credits__ = ["o-murphy"]
__version__ = "1.1.2"
__version__ = "1.1.3"

from .drag_model import *
from .trajectory_calc import *

0 comments on commit 7ed8054

Please sign in to comment.